久艹网,456看看亚洲,91色在线,国产一级特黄aaa片做受小说

中山php|最優(yōu)網(wǎng)絡(luò)中山做網(wǎng)站 中山php建站

最優(yōu)良人

2011/08/15 at 16:08

PHP利用header函數(shù)實(shí)現(xiàn)各種狀態(tài)的跳轉(zhuǎn)

header實(shí)現(xiàn)301永久重定向
Header("HTTP/1.1 301 Moved Permanently");
Header("Location: http://");

header實(shí)現(xiàn)302臨時(shí)重定向
Header("HTTP/1.1 302 Found");
Header("Location: http://");

header實(shí)現(xiàn)404無(wú)法找到頁(yè)面
Header("HTTP/1.1 404 Not Found");

一下函數(shù)可實(shí)現(xiàn)各種狀態(tài)的跳轉(zhuǎn):

/**
* 跳轉(zhuǎn)頁(yè)面
*
* 使用header()進(jìn)行頁(yè)面跳轉(zhuǎn),不顯示任何內(nèi)容.如果不能使用header跳轉(zhuǎn)
* @param string $url
* @param int $status
*/
function goto($url,$status=null)
{
if(!empty($status))
{
$status=intval($status);
$codes = array(
100 => "Continue",
101 => "Switching Protocols",
200 => "OK",
201 => "Created",
202 => "Accepted",
203 => "Non-Authoritative Information",
204 => "No Content",
205 => "Reset Content",
206 => "Partial Content",
300 => "Multiple Choices",
301 => "Moved Permanently",
302 => "Found",
303 => "See Other",
304 => "Not Modified",
305 => "Use Proxy",
307 => "Temporary Redirect",
400 => "Bad Request",
401 => "Unauthorized",
402 => "Payment Required",
403 => "Forbidden",
404 => "Not Found",
405 => "Method Not Allowed",
406 => "Not Acceptable",
407 => "Proxy Authentication Required",
408 => "Request Time-out",
409 => "Conflict",
410 => "Gone",
411 => "Length Required",
412 => "Precondition Failed",
413 => "Request Entity Too Large",
414 => "Request-URI Too Large",
415 => "Unsupported Media Type",
416 => "Requested range not satisfiable",
417 => "Expectation Failed",
500 => "Internal Server Error",
501 => "Not Implemented",
502 => "Bad Gateway",
503 => "Service Unavailable",
504 => "Gateway Time-out"
);
if (array_key_exists($status,$codes)) {
$code = $status;
$msg = $codes[$status];
$status = "HTTP/1.1 {$code} {$msg}";
} else {
$status = null;
}
}
if (!empty($status)) {
header($status);
}
if(!empty($url)) {
$url=url($url);header("Location: $url");
if ($code==404) {
echo "<meta http-equiv='refresh' content='0;url=$url'>";
}
}
exit;
}

標(biāo)簽:,
-
精品视频一区二区三区| 国产 欧美 视频一区二区三区| 亚洲av区一区二| 九色这里只有精品| 日韩中一区二区三区| 欧美精品玖玖| 欧美a级大片| 成人h在线| 富民县| 久久无码一级| 国产精品美女视频| 国产强伦姧在线看| 久久涩爱综合| 亚洲欧美日韩国产中文卡区码综精| 太久欧美| 亚洲精品xxx| 国产日韩亚洲| av免费看网站| 第四色网男人天堂| 二色av| 中文久久精品视频| tcsofia.com| 久久久精品欧美一区二区| 国产AV最新精品自在自线| 国产精品亚欧美洲在线| 亚洲日韩精品国产一区二区三区| 亚洲影院久久| 久久毛片免费观看| 毛片色毛片18毛片美女| 成人精品| 国产亚洲欧美精品久久久久| 欧美一区二区三区欧美日韩久久| 天天综合三级片| 免费激情网站| 噜噜av| 久草这里只有精品| 九九九九九伊人| 涩爱av无码一区二区三区| 亚洲一区二区三区久久久久| 无码精品人妻一区二区三区影院| 熟女日韩|