Creating a new user is very easy in Drupal 6. Here's how.
[sourcecode language="php"]
>
$new_user = array(
'name' => $username,
'mail' => $mail,
'pass' => user_password(),
'status' => 1,
'auth_MODULENAME' => $username
)
$user = user_save(NULL,$new_user)
// log the user in
$user = user_authenticate($new_user)
[/sourcecode]
Now for the explanation. We create a $new_user array with values …