Hi,
i got this really strange beginners problem. I want to use a form and then capture and store variables from it. But i can never capture forms variable althou they can be seen with print_r function. Please help me to capture it.
Here is the code i use for form generation:
//form for variable setting.
$forma[urly] = array(
'#type' => 'textfield',
'#title' => t('Enter Yahoo news URL'),
'#default_value' => 'http://www.yahoo.org/',
'#maxlenght' => '333',
);
$forma['submit'] = array('#type' => 'submit', '#value' => t('Save new settings.'));
//let's add this form to output
$output .= drupal_get_form('my_form', $forma);
and above it i try to capture $_POST[edit][urly] with this code:
//$output .= '<pre>' . print_r ($_POST) . '</pre>'; //debug line
$output .= 'XX'. $_POST['edit']['urly'] . 'XX'; //debug line
variable_set('importNewsURLyahoo',$_POST['edit']['urly']);
$output .= variable_get('importNewsURLyahoo','Variable never been set before.');
print_r if uncommented shows:
Array
(
[edit] => Array
(
[urly] => http://www.yahoo.org/dcsd
[form_id] => my_form
)
[op] => Save new settings.
)
Please tell me how to access that urly field variable.
Thank you and sorry if it's more PHP than drupal related problem ;-)