Unable to save variable(s) from a custom form I want to create a custom form with a few textfields and then use variable_set to save those textfields as variables. 

I am not able to save the variable with the code below. 

Question: I do not see the drupal message on hitting submit and when I go to the 'variables' table, I do not see the variable 'id_event'. I have tried clearing all caches several times.

Code below is from *.module file of my custom module "mymodule"

    function mymodule_menu() {

     $items['example_form'] = array(
         'title'        =&gt;  'Progress Numbers',
         'description'  =&gt;  'Form to enter variables that will be shown on Progress Update Block on Front Page',
         'page callback'    =&gt; 'drupal_get_form',
         'page arguments'   =&gt; array('example_form_form1'),
         'access arguments' =&gt; array('access administration menu'),

     );

     return $items;
 }


The callback function:

 function example_form_form1($form, &amp;$form_state) {
  $form['id_event'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Id Event'),
    '#required' =&gt; TRUE,
    '#default_value' =&gt; variable_get('id_event', 7),
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Submit'),
  );
  return $form;
}


Submit Function

function example_form_form1_submit(&amp;$form, &amp;$form_state) {
  variable_set('id_event', $form_state['values']['id_event']);
  drupal_set_message($id_event);
}
Modify your example_form_form1_submit function as follows

function example_form_form1_submit(&amp;$form, &amp;$form_state) {
  variable_set('id_event', $form_state['values']['id_event']);
  $id_event = variable_get('id_event', '');
  drupal_set_message($id_event);
}