亚洲啪啪,久久精品一区二区日本,欧美字幕一区,日韩AV高清在线观看

中山php|最優(yōu)網絡中山做網站 中山php建站

最優(yōu)良人

2011/08/15 at 16:08

PHP利用header函數實現各種狀態(tài)的跳轉

header實現301永久重定向
Header("HTTP/1.1 301 Moved Permanently");
Header("Location: http://m.dgkai.cn");

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

header實現404無法找到頁面
Header("HTTP/1.1 404 Not Found");

一下函數可實現各種狀態(tài)的跳轉:

/**
* 跳轉頁面
*
* 使用header()進行頁面跳轉,不顯示任何內容.如果不能使用header跳轉
* @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;
}

標簽:,
-
日韩精品伦理片| 被怪物操逼视频| 欧美桃色樱花久久综合| 青青久久精品拔插视频区一区二| 日韩激情 一区二区| 在线人人干人人爽| 精品国产少妇内射| 久久久艹免费视频| caoporn超碰最新在线入口| 欧美偷拍五区| 日韩亚洲成人午夜电影动漫| 少妇色18p| 香蕉香蕉大香蕉在线观看| 成人阴院五月天| 欧国产精品九九99久久在免费| 中文字幕一区在线的| 天天天天天天天天射射射射射| 岛国精品一区二区免费| www.国产porn.copm| 午夜福利a91| 久久99久久99国产精品| 国产色呦在线观看| 国产精品91视频网| 懂色av中文一区二区| 亚洲欧洲视频在线www| 天天天天天天天操| 啊啊啊舒服嗯| 日本欧美国产免费| 亚洲庶男黑人国产精品在线观看| 国产按头囗爆吞精视频3p| 久久中文精品字幕| 久久久成年| 色色AV网站| 你懂的在线播放日韩精品| 好叼妞视频免费看| 天天日天天天天操| 99精品欧美一区二区蜜桃美图| 国产精品43页| 精品婷婷嗷嗷色| 激情 一区二区三区| 午夜在线欧美日韩在线国产|