How to call a function on node submit in drupal 7 I have created content type programmatically.. I don't want to display its node data in a block. Now I want to fetch data and save fetched data in a variable.
How can I do it ?

Or else how can I call a function on node submit ?

here is my code : 

function default_content_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    debug($form_id);exit;

    switch($form_id) {
        case 'name_of_the_form':
            $form['#submit'][] = 'test_form_submit';
        break;
    }
}
function MODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) 
{
  //echo $form_id; // get the form id 
    switch($form_id)
    {
        case 'name_of_the_form': 
           $form['#submit'][] = 'test_form_submit';
           break;
    }
}

function test_form_submit($form, &amp;$form_state)
{
  drupal_set_message("How are you");
}