drupal_redirect_form

6/includes/form.inc, line 617

Versions
6 – 5
drupal_redirect_form($form, $redirect = NULL)

Redirect the user to a URL after a form has been processed.

Parameters

$form An associative array containing the structure of the form.

$redirect An optional value containing the destination path to redirect to if none is specified by the form.

Related topics

▾ 9 functions call drupal_redirect_form()

ctools_process_form in contributions/ctools/includes/form.inc
ctools' replacement for drupal_process_form that accepts commands not to redirect, as well as forcing processing of 'get' method forms.
ctools_wizard_multistep_form in contributions/ctools/includes/wizard.inc
Display a multi-step form.
delegator_page_add_subtask in contributions/ctools/delegator/plugins/tasks/page.admin.inc
Page callback to add a subtask.
delegator_page_edit_subtask in contributions/ctools/delegator/plugins/tasks/page.admin.inc
Page callback to add a subtask.
drupal_process_form in 6/includes/form.inc
This function is the heart of form API. The form gets built, validated and in appropriate cases, submitted.
drupal_process_form_new in contributions/views/includes/form.inc
Views' replacement for drupal_process_form that accepts commands not to redirect, as well as forcing processing of 'get' method forms.
drupal_redirect_form in 6/includes/form.inc
Redirect the user to a URL after a form has been processed.
openid_authentication in 6/modules/openid/openid.module
Authenticate a user or attempt registration.
_batch_finished in 6/includes/batch.inc
End the batch processing: Call the 'finished' callbacks to allow custom handling of results, and resolve page redirection.

Code

<?php
function drupal_redirect_form($form, $redirect = NULL) {
  $goto = NULL;
  if (isset($redirect)) {
    $goto = $redirect;
  }
  if ($goto !== FALSE && isset($form['#redirect'])) {
    $goto = $form['#redirect'];
  }
  if (!isset($goto) || ($goto !== FALSE)) {
    if (isset($goto)) {
      if (is_array($goto)) {
        call_user_func_array('drupal_goto', $goto);
      }
      else {
        drupal_goto($goto);
      }
    }
    drupal_goto($_GET['q']);
  }
}
?>