drupal_redirect_form

After a form was executed, the data in $form_state controls whether the form
is redirected. By default, we redirect to a new destination page. The path
of the destination page can be set in $form_state['redirect'], as either a
string containing the destination or an array of arguments compatible with
drupal_goto(). If that is not set, the user is redirected to the current
page to display a fresh, unpopulated copy of the form.

If $form_state['redirect'] is FALSE, a form builder function or form
validation/submit handler does not want a user to be redirected, which
means that drupal_goto() is not invoked. For most forms, the redirection
logic will be the same regardless of whether $form_state['redirect'] is
undefined or FALSE. However, in case it was not defined and the current
request contains a 'destination' query string, drupal_goto() will redirect
to that given destination instead. Only setting $form_state['redirect'] to
FALSE will prevent any redirection.

If $form_state['no_redirect'] is TRUE, then the callback that originally
built the form explicitly disallows any redirection, regardless of the
redirection value in $form_state['redirect']. For example, ajax_get_form()
defines $form_state['no_redirect'] when building a form in an Ajax
callback to prevent any redirection. $form_state['no_redirect'] should NOT
be altered by form builder functions or form validation/submit handlers.

If $form_state['programmed'] is TRUE, the form submission was usually
invoked via drupal_form_submit(), so any redirection would break the script
that invoked drupal_form_submit().

If $form_state['rebuild'] is TRUE, the form needs to be rebuilt without
redirection.