亚洲精品合集,亚洲四区五区三区精品,狠狠干视频美利坚 http://m.dgkai.cn/blog 中山php|最優(yōu)網(wǎng)絡(luò) Mon, 13 May 2013 04:56:43 +0000 en hourly 1 http://wordpress.org/?v=3.1.4 PHP利用header函數(shù)實(shí)現(xiàn)各種狀態(tài)的跳轉(zhuǎn) http://m.dgkai.cn/blog/view-129.html http://m.dgkai.cn/blog/view-129.html#comments Mon, 15 Aug 2011 08:08:58 +0000 lin http://m.dgkai.cn/blog/?p=129 header實(shí)現(xiàn)301永久重定向
Header("HTTP/1.1 301 Moved Permanently");
Header("Location: http://m.dgkai.cn");

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

header實(shí)現(xiàn)404無法找到頁(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;
}

]]>
http://m.dgkai.cn/blog/view-129.html/feed 250
精品国产综合AV一区二区三区| 在线国产中文一区| 女同欧美成人视频在线免费| 中文字幕一卡一二三区| 夫妻生活网站一区二区三区| 狂吃奶头60分钟免费观看| niuganwang好吊妞| 精品一区欧美一级| 色呦呦官网国产精品| 台湾少妇中文网| 激情国产 欧美精品| 日韩中字在线91| 大香蕉在线老熟妇| 黄色午夜黄色午夜片| 久久亚洲欧美日韩图片| 中文字幕Av一区二区三| sv中文字幕天堂在线| 黄网站AV| 操美女小骚逼骚逼骚逼| aV蜜臀在线观看| 极品丝袜少妇在线影院| 欧美精品一区二区三区乱码| 国产人人人看91| 射射射视频| 日韩精品久久AV一区二区三区| 国外在线免费视频你懂得| 久久久精品96一区二区| 欧美男人草女人| 视频久久久久久久久久久| 国产精品久久久久av免费嫩粉| 熟女熟妇AV网站密桃| 久久青青草原亚洲AV无码不卡| 草.B在线视频| 熟妇乐园AV| 黄色午夜、| 中美日韩成人在线观看| 欧美91精品国产| 日本熟女一二三| 国产欧美中文在线| 操逼喷潮视频网站视频| 欧美亚洲tv大片在线播放|