redirect.lib.php File Reference

The redirect function. More...

Go to the source code of this file.

Functions

 redirect ($location='/', $http_status=HTTP_STATUS_FOUND)
 This function redirects the browser and stops further processing.


Detailed Description

The redirect function.

See also:
redirect

Definition in file redirect.lib.php.


Function Documentation

redirect ( location = '/',
http_status = HTTP_STATUS_FOUND 
)

This function redirects the browser and stops further processing.

There's no need to call die()/exit() after calling this function, because execution stops at the end of this method.

Parameters:
$location An optional parameter specifying the url to redirect to. This defaults to / (used if omitted). You can also use a numeric -1 to use the HTTP referrer if available (will default to / if no referrer was sent).
$http_status An optional parameter specifying the http status to be sent back to the browser. If omitted, HTTP/1.1 302: Found will be used.
Examples:

 redirect();        // redirect to /
 redirect('/foo');  // redirect to /foo
 redirect('/bar', HTTP_STATUS_MOVED_PERMANENTLY);
                    // redirect to /bar with a
                    // permanent redirect (i.e. client should remember
                    // the new address instead of the old one)
 redirect(-1);      // redirect to the referring page

Definition at line 43 of file redirect.lib.php.


Generated on Sun Aug 2 22:54:37 2009 for Anewt by  doxygen 1.5.9