drupal_goto($path = '', $query = NULL, $fragment = NULL,
$http_response_code = 302)
This simple function initiates an immediate redirect of the user to the URL indicated. The function contains additional parameters to handle complex URL building and supports RFC 2616 by registering an HTTP code for the redirect.
The parameters are parsed by this code fragment:
$url = url($path, array('query' => $query, 'fragment' => $fragment, 'absolute' =>
TRUE));
The array is relatively straight forward with the [0] element as the actual address, and the query(if any) loaded into an associative part of the array and the fragments(if any) also loaded into an associative part of the array.
The PHP function 'header()' does the heavy lifting in the function by setting the destination and giving the response code to the users browser:
header('Location: '. $url, TRUE, $http_response_code);