Query: http_redirect
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
HTTP_REDIRECT(3) 1 HTTP_REDIRECT(3) http_redirect - Issue HTTP redirectSYNOPSISbool http_redirect ([string $url], [array $params], [bool $session = false], [int $status])DESCRIPTIONRedirect 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.PARAMETERSo $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 codeRETURN VALUESReturns FALSE or exits on success with the specified redirection status code. See the INI settinghttp.force_exit for what "exits" means.EXAMPLESExample #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 ALSOthe HttpResponse class if you are using PHP 5.1.0 and above. PHP Documentation Group HTTP_REDIRECT(3)
Similar Topics in the Unix Linux Community |
---|
Redirection Problem |
system command |
Ambiguous output redirect error |
I want to redirect ls of server ftp |
Echo cannot redirect first or second output to logfile |