By tchivoan1972 on
i am writing a module that form user registration form, how do i find out what the user id is when site admin create a user account?
i tryed global $user and useing $user->uid but that gives me the admin uid not the newly created account id.
Comments
You could implement
You could implement hook_user_insert and look at $account.
how would you get values from
how would you get values from form elements that you added to the registration form.
As nevets said, you can use
As nevets said, you can use
hook_user_inserthook to catch user insertion, and use variables. First you need to create a custom module ( http://drupal.org/developing/modules ) then implement thehook_user_insert( http://api.drupal.org/api/drupal/modules--user--user.api.php/function/ho... ) , and every time a user gets added to your system, the user_insert hook in your module will be executed by drupal, and the following data will be passed to your function:Hope it helps !
ok thanks, another question
ok thanks, another question how can i get drupal to display the content of the array $edit or $account? i tried using var_dump and print_r but doesn't seem to do anything.
If you have the devel module
If you have the devel module installed you can use dsm($some_variable).
Without devel I use
drupal_set_message('<pre>' . print_r($some_variable, TRUE) . '</pre>');