Search code examples
drupalsubmit-button

Drupal:Direct a user to a specific page after submitting


I have a submitt drupal form in a my module:

$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
 );

And this is my submitt function , what command have to add to direct the user to a specific page with a specific path? I tried this but it didnt work

function testform_submit($form, &$form_state) {
 $form_state['submit'] = 'https://www.google.de/';

}

Solution

  • So close...

    function testform_submit($form, &$form_state) {
      $form_state['redirect'] = 'https://www.google.de/';
    }