Creating node and user with one form I have a content type, 'A'.
Now I need a form with the user registration form fields plus the 'A' creation form fields.
So when the user (annonymous) submits this form, a user and a node of type 'A' with the filled information would be created.

I have this for now:

function my_module_menu() {
  $items['create_node_and_user'] = array(
    'page callback' =&gt; 'user_and_node_creation_form',
    'type' =&gt; MENU_CALLBACK,
    'access callback' =&gt; TRUE,
  );

  return $items;
}

function user_and_node_creation_form() {
  module_load_include('inc', 'node', 'node.pages');
  $output = array();
  $output['user'] = drupal_get_form('user_register_form');
  $output['node_type_a'] = node_add('node_type_a');

  return $output;
}


The form is displayed fine, but How can I add a submit handler to manage the node creation after register the user?
The Create &amp; Register module does this for you if you don't mind using a contrib module. From the project page...


  This module creates a "lazy registration" which means that the user
  creates the content first and after this logs in or registers to the
  site.
  
  Process
  
  
  anonymous user creates a content 
  the user will be redirected to the login page (if you set it on the settings form) after he finished the node creation 
  the user registers or logs in 
  the created node(s) will be assigned to the user after logging in