/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php 'name' => 'username', 'pass' => 'password', // note: do not md5 the password 'mail' => 'email address', 'status' => 1, 'init' => 'email address' ); user_save(null, $newUser); ?> And, here's how you can update an existing user: <?php // load user object $existingUser = user_load('USERID'); // update some user property $existingUser->some_property = 'blah'; // save existing user ?>
URL: http://www.michaelphipps.com/how-create-users-programmatically-drupal-6x
Comments
