<br><br><div><span class="gmail_quote">On 8/18/06, <b class="gmail_sendername">Jeff Eaton</b> <<a href="mailto:jeff@viapositiva.net">jeff@viapositiva.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><div><font face="Verdana" size="2"><br>function mymodule_create_user()
{<br> // register a new user<br> $form =
drupal_retrieve_form('user_register');<br> $form['#post']['edit']['name']
= 'robo-user';<br> $form['#post']['edit']['mail'] = <a href="mailto:%27robouser@example.com%27" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">'robouser@example.com'</a>;<br>
$form['#post']['edit']['pass'] = 'password';<br>
drupal_process_form('user_register', $form);<br></font></div></div></div></blockquote></div>This is awesome, but do we really need the '#post']['edit'] for every element ?<br><br>for shorthand, couldn't we just do<br><br>
$edit = drupal_retrieve_post('user_register');<br>$edit['name'] = 'robo-user';<br>$edit['mail'] = 'something';<br>$edit['pass'] = 'blah';<br>drupal_process_form('user_register', $edit);<br><br>You could have this as a wrapper of the functionality you mentioned above even.
<br><br><br><br>