You are here

function hosting_signup_form_submit in Hosting 6.2

Same name and namespace in other branches
  1. 5 signup/hosting_signup.module \hosting_signup_form_submit()
  2. 7.4 signup/hosting_signup.module \hosting_signup_form_submit()
  3. 7.3 signup/hosting_signup.module \hosting_signup_form_submit()

Form submission

Generates the nodes and saves them.

File

signup/hosting_signup.module, line 111
Provides a signup form that can be run on remote sites

Code

function hosting_signup_form_submit($form, &$form_state) {
  $client = (object) $form_state['values'];
  $client->type = 'client';
  $client->status = 1;
  $client->title = $client->client_name;
  node_save($client, 'submit');
  $site = (object) $form_state['values'];
  $site->type = 'site';
  $site->status = 1;
  $site->client = $client->nid;
  $site->uid = $client->uid;
  node_save($site);
  $form_state['redirect'] = sprintf("hosting/signup/thanks/%s/%s/%s", $site->title, $client->email, $client->client_name);
}