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. | |
Definition in file redirect.lib.php.
| 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.
| $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. |
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.
1.5.9