国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

香港云服务器
服務器之家 - 編程語言 - PHP教程 - 基于header的一些常用指令詳解

基于header的一些常用指令詳解

2020-04-06 11:41PHP教程網 PHP教程

本篇文章是對header的一些常用指令進行了詳細的分析介紹,需要的朋友參考下

header常用指令
header分為三部分:

第一部分為HTTP協議的版本(HTTP-Version);
第二部分為狀態代碼(Status);
第三部分為原因短語(Reason-Phrase)。

// fix 404 pages:   用這個header指令來解決URL重寫產生的404 header
header('HTTP/1.1 200 OK');  

// set 404 header:   頁面沒找到
header('HTTP/1.1 404 Not Found');  

//頁面被永久刪除,可以告訴搜索引擎更新它們的urls
// set Moved Permanently header (good for redrictions)  
// use with location header  
header('HTTP/1.1 301 Moved Permanently'); 

// 訪問受限
header('HTTP/1.1 403 Forbidden');

// 服務器錯誤
header('HTTP/1.1 500 Internal Server Error');

// 重定向到一個新的位置
// redirect to a new location:  
header('Location: http://www.example.org/');  

延遲一段時間后重定向
// redrict with delay:  
header('Refresh: 10; url=http://www.example.org/');  
print 'You will be redirected in 10 seconds';  

// 覆蓋 X-Powered-By value
// override X-Powered-By: PHP:  
header('X-Powered-By: PHP/4.4.0');  
header('X-Powered-By: Brain/0.6b');  

// 內容語言 (en = English)
// content language (en = English)  
header('Content-language: en');  

//最后修改時間(在緩存的時候可以用到)
// last modified (good for caching)  
$time = time() - 60; // or filemtime($fn), etc  
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');  

// 告訴瀏覽器要獲取的內容還沒有更新
// header for telling the browser that the content  
// did not get changed  
header('HTTP/1.1 304 Not Modified');  

// 設置內容的長度 (緩存的時候可以用到):
// set content length (good for caching):  
header('Content-Length: 1234');  

// 用來下載文件:
// Headers for an download:  
header('Content-Type: application/octet-stream');  
header('Content-Disposition: attachment; filename="example.zip"');  
header('Content-Transfer-Encoding: binary');  

// 禁止緩存當前文檔:
// load the file to send:readfile('example.zip');  
// Disable caching of the current document:  
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');  
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');  

// 設置內容類型:
// Date in the pastheader('Pragma: no-cache');  
// set content type:  
header('Content-Type: text/html; charset=iso-8859-1');  
header('Content-Type: text/html; charset=utf-8');  
header('Content-Type: text/plain');  

// plain text file  
header('Content-Type: image/jpeg');  

// JPG picture  
header('Content-Type: application/zip');  

// ZIP file  
header('Content-Type: application/pdf');  

// PDF file  
header('Content-Type: audio/mpeg');  

// Audio MPEG (MP3,...) file  
header('Content-Type: application/x-shockwave-flash');  

// 顯示登錄對話框,可以用來進行HTTP認證
// Flash animation// show sign in box  
header('HTTP/1.1 401 Unauthorized');  
header('WWW-Authenticate: Basic realm="Top Secret"');  
print 'Text that will be displayed if the user hits cancel or ';  

print 'enters wrong login data';?>

// 發送一個200 正常響應
header("HTTP/1.1 200 OK");

// 發送一個404 找不到資源響應
header('HTTP/1.1 404 Not Found');

// 發送一個301 永久重定向
header('HTTP/1.1 301 Moved Permanently');

// 發送一個503 網站暫時不能訪問
header('HTTP/1.1 503 Service Temporarily Unavailable');

// 網頁重定向
header('Location: //www.jfrwli.cn');

// 設置網頁3秒后重定向
header('Refresh: 3; url=//www.jfrwli.cn');
echo '網頁將在3秒后跳轉到//www.jfrwli.cn';

// 設置網頁編碼
header('Content-Type: text/html; charset=utf-8');

// 設置網頁輸出一個圖片流
header('Content-Type: image/jpeg');

// 設置網頁輸出一個pdf文檔
header('Content-Type: application/pdf');

// 設置網頁輸出一個zip文檔
header('Content-Type: application/zip');

延伸 · 閱讀

精彩推薦
281
主站蜘蛛池模板: 欧美国产一区二区三区 | 在线干 | 91免费在线播放 | 日本一区二区视频免费观看 | 亚洲一区二区视频在线观看 | 亚洲精品在线播放 | 午夜成人免费视频 | 欧美日韩在线免费 | 精品久久久久久久久久久久久久久久久久久 | 成人精品视频在线观看 | 色婷婷综合久色 | 国产精品网站在线观看 | 亚州中文字幕 | 成人精品电影 | 精品日韩一区二区 | 日日干夜夜干 | aaa黄色片| 免费污污视频在线观看 | 国产成人99久久亚洲综合精品 | 亚洲一区二区免费看 | 国产精品久久久久久久久久久久| 日本中文字幕在线观看 | 看亚洲a级一级毛片 | 精品国产一区二区三区性色av | 成人在线免费观看视频 | japan23xxxxhd乱| 久久精品国产欧美亚洲人人爽 | 国产精品久久久久久久久 | 欧美人交a欧美精品 | 热久久国产 | 国产一区二区三区四区在线观看 | 国产一区二区三区在线 | 色站综合| 欧美大片aaaa在线观看 | av电影一区二区 | 狠狠久 | 欧美激情在线观看 | 久久av网| 91视频.com| 亚洲大片av | 久久综合久久久 |