Drupal – Redirect after form submission

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'my_form') {
     $form['#submit'][] = 'my_submit_handler';
  }
}
 
function my_submit_handler(&$form, &$form_state) {
  $form_state['redirect'] = 'home';
}

Source: http://goo.gl/it93ym

Leave a Reply

Your email address will not be published. Required fields are marked *