Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

http_redirect(3) [php man page]

HTTP_REDIRECT(3)							 1							  HTTP_REDIRECT(3)

http_redirect - Issue HTTP redirect

SYNOPSIS
bool http_redirect ([string $url], [array $params], [bool $session = false], [int $status]) DESCRIPTION
Redirect to the given url. The supplied $url will be expanded with http_build_url(3), the $params array will be treated with http_build_str(3) and the session iden- tification will be appended if $session is true. The HTTP response code will be set according to $status. You can use one of the redirect constants for convenience. Please see RFC 2616 for which redirect response code to use in which situation. By default PHP will decide which response status fits best. To be RFC compliant, "Redirecting to <a>URL</a>." will be displayed, if the client doesn't redirect immediately, and the request method was another one than HEAD. A log entry will be written to the redirect log, if the INI settinghttp.log.redirect is set and the redirect attempt was successful. PARAMETERS
o $url - the URL to redirect to o $params - associative array of query parameters o $session - whether to append session information o $status - custom response status code RETURN VALUES
Returns FALSE or exits on success with the specified redirection status code. See the INI settinghttp.force_exit for what "exits" means. EXAMPLES
Example #1 A http_redirect(3) example <?php http_redirect("relpath", array("name" => "value"), true, HTTP_REDIRECT_PERM); ?> The above example will output: HTTP/1.1 301 Moved Permanently X-Powered-By: PHP/5.2.2 Content-Type: text/html Location: http://www.example.com/curdir/relpath?name=value&PHPSESSID=abc Redirecting to <a href="http://www.example.com/curdir/relpath?name=value&PHPSESSID=abc">http://www.example.com/curdir/relpath?name=value&PHPSESSID=abc</a>. SEE ALSO
the HttpResponse class if you are using PHP 5.1.0 and above. PHP Documentation Group HTTP_REDIRECT(3)

Check Out this Related Man Page

HTTPRESPONSE(3) 							 1							   HTTPRESPONSE(3)

The HttpResponse

CLASS SYNOPSIS
HttpResponse HttpResponse o static void HttpResponse::capture (void ) o static int HttpResponse::getBufferSize (void ) o static bool HttpResponse::getCache (void ) o static string HttpResponse::getCacheControl (void ) o static string HttpResponse::getContentDisposition (void ) o static string HttpResponse::getContentType (void ) o static string HttpResponse::getData (void ) o static string HttpResponse::getETag (void ) o static string HttpResponse::getFile (void ) o static bool HttpResponse::getGzip (void ) o static mixed HttpResponse::getHeader ([string $name]) o static int HttpResponse::getLastModified (void ) o static string HttpResponse::getRequestBody (void ) o static resource HttpResponse::getRequestBodyStream (void ) o static array HttpResponse::getRequestHeaders (void ) o static resource HttpResponse::getStream (void ) o static float HttpResponse::getThrottleDelay (void ) o static string HttpResponse::guessContentType (string $magic_file, [int $magic_mode = MAGIC_MIME]) o static void HttpResponse::redirect ([string $url], [array $params], [bool $session = false], [int $status]) o static bool HttpResponse::send ([bool $clean_ob = true]) o static bool HttpResponse::setBufferSize (int $bytes) o static bool HttpResponse::setCache (bool $cache) o static bool HttpResponse::setCacheControl (string $control, [int $max_age], [bool $must_revalidate = true]) o static bool HttpResponse::setContentDisposition (string $filename, [bool $inline = false]) o static bool HttpResponse::setContentType (string $content_type) o static bool HttpResponse::setData (mixed $data) o static bool HttpResponse::setETag (string $etag) o static bool HttpResponse::setFile (string $file) o static bool HttpResponse::setGzip (bool $gzip) o static bool HttpResponse::setHeader (string $name, [mixed $value], [bool $replace = true]) o static bool HttpResponse::setLastModified (int $timestamp) o static bool HttpResponse::setStream (resource $stream) o static bool HttpResponse::setThrottleDelay (float $seconds) o static bool HttpResponse::status (int $status) CLASS MEMBERS
PROPERTIES
Static Properties +----------+-------------------------------+---+---+ |Modifiers | | | | | | | | | | | Type | | | | | | | | | | Name | | | | | | | | | | Description | | | | | | | | +----------+-------------------------------+---+---+ |protected | | | | | | | | | | | boolean | | | | | | | | | | cache | | | | | | | | | | whether caching the response | | | | | should be attempted | | | | | | | | |protected | | | | | | | | | | | boolean | | | | | | | | | | gzip | | | | | | | | | | whether the sent entity | | | | | should be gzip'ed on the fly | | | | | | | | |protected | | | | | | | | | | | string | | | | | | | | | | eTag | | | | | | | | | | the generated or custom ETag | | | | | | | | |protected | | | | | | | | | | | integer | | | | | | | | | | lastModified | | | | | | | | | | the generated or custom time- | | | | | stamp of last modification | | | | | | | | |protected | | | | | | | | | | | string | | | | | | | | | | cacheControl | | | | | | | | | | | | | | | Cache-Control setting | | | | | | | | |protected | | | | | | | | | | | string | | | | | | | | | | contentType | | | | | | | | | | the Content-Type of the sent | | | | | entity | | | | | | | | |protected | | | | | | | | | | | string | | | | | | | | | | contentDisposition | | | | | | | | | | the Content-Disposition of | | | | | the sent entity | | | | | | | | |protected | | | | | | | | | | | integer | | | | | | | | | | bufferSize | | | | | | | | | | the chunk buffer size used | | | | | for throttling | | | | | | | | |protected | | | | | | | | | | | double | | | | | | | | | | throttleDelay | | | | | | | | | | the seconds to delay when | | | | | throttling | | | | | | | | +----------+-------------------------------+---+---+ PREDEFINED CONSTANTS
+--------+--------------------------------------+---+ | Type | | | | | | | | | Name | | | | | | | | Description | | | | | | +--------+--------------------------------------+---+ |integer | | | | | | | | | REDIRECT | | | | | | | | guess applicable redirect method | | | | | | |integer | | | | | | | | | REDIRECT_PERM | | | | | | | | permanent redirect ( 301 Moved per- | | | | manently) | | | | | | |integer | | | | | | | | | REDIRECT_FOUND | | | | | | | | standard redirect ( 302 Found) | | | | | | |integer | | | | | | | | | REDIRECT_POST | | | | | | | | redirect applicable to POST requests | | | | ( 303 See other) | | | | | | |integer | | | | | | | | | REDIRECT_PROXY | | | | | | | | proxy redirect ( 305 Use proxy) | | | | | | |integer | | | | | | | | | REDIRECT_TEMP | | | | | | | | temporary redirect ( 307 Temporary | | | | Redirect) | | | | | | +--------+--------------------------------------+---+ PHP Documentation Group HTTPRESPONSE(3)
Man Page