By crashpoint on
hi,
i installed the form module and worked out this code. Its is supposed to take in username and email and print them out. i created this code
-----------
$form['user']["name"] = array(
'#type' => 'textfield',
'#title' => t('user_name'),
'#default_value' => 'crashpoint',
'#size' => 30,
'#maxlength' => 30,
'#description' => 'enter the username',
'#attributes' => NULL,
'#required' => TRUE,
);
$form['user']["email"] = array (
'#type' => 'textfield',
'#title' => t('email'),
'#default_value' => 'crashpoint@gmail.com',
'#size' => 20,
'#maxlength' => 20,
'#description' => 'enter the email',
'#attributes' => NULL,
'#required' => TRUE,
);
$form['submit_button'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
$output = drupal_get_form('create_form', $form);
print $output;
----------
This prints the form. But how do I go about printing the values that this form passes in the post array. I saw that the $_POST['edit'] array was used
So to the above snippet I added the lines
------------------
print "<br/><br/>";
$op = $_POST['edit'];
print "email is ".$op["email"]."<br/>";
------------
but it does not show any output. Can anyone please point out where am i going wrong?