fp_goto

5.x misc.inc fp_goto($path, $query = "")
4.x misc.inc fp_goto($path, $query = "")

Redirect the user's browser to the specified internal path + query.

We will automatically add the current_student_id variable, if it is not present in the query.

Example uses:

30 calls to fp_goto()
admin_edit_degree_form_submit in modules/admin/admin.degrees.inc
admin_edit_group_form_submit in modules/admin/admin.groups.inc
advise_init_screen in modules/advise/advise.module
advise_perform_clear_advising_cache in modules/advise/advise.module
From menu hook. Clear just the advising cache.
advise_what_if_selection_form_submit in modules/advise/advise.module
Submit handler for the what if selection form. Since at this point we have passed validation, let's just assemble the URL we need to now redirect to.

... See full list

File

includes/misc.inc, line 1390
This file contains misc functions for FlightPath

Code

function fp_goto($path, $query = "") {
  global $current_student_id;

  if ($current_student_id != "" && !strstr($query, "current_student_id=")) {
    // If the query doesn't contain the current_student_id, then add it in.
    $query .= "&current_student_id=$current_student_id";
  }

  // Close the seesion before we try to redirect.
  session_write_close();

  if ($path == "<front>") {
    $path = variable_get("front_page", "main");
  }

  header('Location: ' . fp_url($path, $query));
  exit();

}