<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                #### PHP 中 header 用法詳解 header is used to send raw HTTP headers. See the HTTP/1.1 specification for more information on HTTP headers. 參考:http://php.net/manual/en/function.header.php 范例一: ~~~ <!--?PHP Header("Location: http://www.jb51.net";); exit;//在每個重定向之后都必須加上“exit",避免發生錯誤后,繼續執行。 ?--> ~~~ ~~~ <!--?php header("refresh:2;url=http://www.jb51.net"); echo "正在加載,請稍等...<br-->三秒后自動跳轉至百度..."; ?--> ~~~ 范例三: 讓使用者的瀏覽器出現找不到檔案的信息,正確的寫法是: ~~~ header("http/1.1 404 Not Found"); ~~~ 第一部分為HTTP協議的版本(`HTTP-Version`);第二部分為狀態代碼(`Status`);第三部分為原因短語(`Reason-Phrase`)。 范例四: 讓使用者下載檔案( 隱藏文件的位置 ) html標簽 就可以實現普通文件下載。如果為了保密文件,就不能把文件鏈接告訴別人,可以用header函數實現文件下載。 ~~~ <!--?php header("Content-type: application/x-gzip"); header("Content-Disposition: attachment; filename=文件名/"); header("Content-Description: PHP3 Generated Data"); ?--> ~~~ 范例五: header函數前不能夠輸出內容 一般來說在header函數前不能輸出html內容,就是說在這些函數的前面不能有任何文字、空行、回車等,而且最好在header()函數后加上exit()函數。 類似的還有 `setcookie()` 和 `session` 函數,這些函數需要在輸出流中增加消息頭部信息。如果在`header()`執行之前有`echo`等語句,當后面遇到`header()`時,就會報出 “Warning: Cannot modify header information - headers already sent by ….”錯誤。 例如,下面的正確寫法: ~~~ <!--?php header("http/1.1 403 Forbidden"); exit(); ?--> ~~~ * * * * * ~~~ <!--?php // ok header('HTTP/1.1 200 OK'); //設置一個404頭: header('HTTP/1.1 404 Not Found'); //設置地址被永久的重定向 header('HTTP/1.1 301 Moved Permanently'); //轉到一個新地址 header('Location: http://www.baidu.com'); //文件延遲轉向: header('Refresh: 10; url=http://www.example.org/'); print 'You will be redirected in 10 seconds'; //當然,也可以使用html語法實現 // <cke:encoded-->%3Cmeta%20http-equiv%3D%22refresh%22%20content%3D%2210%3Bhttp%3A%2F%2Fwww.example.org%2F%20%2F%3E // override X-Powered-By: PHP: header('X-Powered-By: PHP/4.4.0'); header('X-Powered-By: Brain/0.6b'); //文檔語言 header('Content-language: en'); //告訴瀏覽器最后一次修改時間 $time = time() - 60; // or filemtime($fn), etc header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT'); //告訴瀏覽器文檔內容沒有發生改變 header('HTTP/1.1 304 Not Modified'); //設置內容長度 header('Content-Length: 1234'); //設置為一個下載類型 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'); // 對當前文檔禁用緩存 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 past header('Pragma: no-cache'); //設置內容類型: header('Content-Type: text/html; charset=iso-8859-1'); header('Content-Type: text/html; charset=utf-8'); header('Content-Type: text/plain'); //純文本格式 header('Content-Type: image/jpeg'); //JPG圖片 header('Content-Type: application/zip'); // ZIP文件 header('Content-Type: application/pdf'); // PDF文件 header('Content-Type: audio/mpeg'); // 音頻文件 header('Content-Type: application/x-shockwave-flash'); //Flash動畫 //顯示登陸對話框 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'; ?--> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看