Hi, All<br><br>I would like to achieve the following: have a user fill the form, create a page populated with data from the form, set a edit/upload password and mail them to the user. But here&#39;s my problem - it seems pretty stupid, but I cannot&#39; set password and populate page at the same time (in one transaction) - it&#39;s either one or another.
<br><br>Basically, my code is like this:<br><br>$base = MakePageName($pagename, &quot;Students.Invitation&quot;);<br>$basegroup = PageVar($base, &#39;$Group&#39;);<br>$newpage = MakePageName($base, &quot;$basegroup.$name&quot;);
<br><br>$new[&#39;text&#39;] = &quot;smth template&quot;;<br><br>PostPage($newpage, $new, $new);<br><br>// ---&nbsp;&nbsp; setting password&nbsp;&nbsp; ---<br>Lock(2);<br>$auth = RetrieveAuthPage($newpage, &#39;attr&#39;, false);<br>$password = gen_password();
<br>$auth[&#39;passwdedit&#39;] = crypt($password);<br>$auth[&#39;passwdupload&#39;] = crypt($password);<br>mail($email, &#39;password&#39;, &quot;$password&quot;);<br>WritePage($page, $auth);<br>Lock(0);<br>// --- done setting password ----
<br><br>Now, it works either with setting &#39;text&#39; or with setting password. I know that the error must be something very simple, but I cannot understand what. Any ideas, please? Pmwiki version is 2.1.27 (latest stable).
<br><br>thanks,<br>Ilja<br><br><br><br><br>