Drupal user_save?

-4 points

How do we use drupal_save function? Can somebody please elaborate?

 

Created by Abdul Abdalllah 45 weeks 4 days ago
  Tags:

Answer(s):

-5 points

It is quite simple. see following:



<?php

 user_save
($account, array('mail'=>'abc@gmail.com');

?>

if $account is null, a new user is created else mail information is updated for $account. I hope this helps.

Created by sudeepg (not verified)
7 points

Actually, if you want to create a new user account, correct syntax is:

 <php><?php

 

$userinfo = array(
'name' => $name,
'pass' => user_password(),
'init' => $name,
'status' => 1, 'mail'=>'abc@abc.com',
      'access' => time()
);
$account = user_save('', $userinfo);

?> </php>

Created by sudeepg

Post your Answer

  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Links to specified hosts will have a rel="nofollow" added to them.

More information about formatting options