I am using Drupal 7. I have Webform with 6 fields:
Your name
User name
password
Email
phone number
Website
If we submit it will store in database, but here I need username & password should store in "User Account Registration" form also.
We can add fields from Configuration -> People -> Account settings for other fields, but it doesn't work in this situation. I need to store the User name & password values to "User Account Form" and then to login with that username and password.
I need to send Email after submitting the form to the particular user. By using webform, we have email settings to send an email.
From One of the forum post I got this solution
**************** Start ***************************
You can make a use of hook_webform_submission_insert
In the implementation hook_webform_submission_insert hook you need to make a use of user_save() function for registering the user on your site.
/**
* Implementation of hook_webform_submission_insert()
*/
function my_registration_webform_submission_insert($node, $submission) {
// $node->nid will be the node id of your webform
if ($node->nid == 2) {
$submitted_data = $submission->data;
$user_name = $submitted_data[1]['value'][0];
$password = $submitted_data[2]['value'][0];
$email = $submitted_data[3]['value'][0];