亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    php header的用法是什么

    php header的用法是:1、跳轉(zhuǎn)頁面;2、聲明【content-type】;3、返回response狀態(tài)碼;4、在某個時間后執(zhí)行跳轉(zhuǎn);5、控制瀏覽器緩存;6、執(zhí)行http驗(yàn)證。

    php header的用法是什么

    相關(guān)學(xué)習(xí)推薦:php編程(視頻)

    php header的用法是:

    1. 跳轉(zhuǎn)頁面

    header('Location:'.$url);  //Location和":"之間無空格

    2. 聲明content-type

    header('content-type:text/html;charset=utf-8');

    3. 返回response狀態(tài)碼

    header('HTTP/1.1 404 Not Found');

    4. 在某個時間后執(zhí)行跳轉(zhuǎn)

    header('Refresh: 10; url=http://www.baidu.com/');  //10s后跳轉(zhuǎn)

    5. 控制瀏覽器緩存

    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache");

    6. 執(zhí)行http驗(yàn)證

    header('HTTP/1.1 401 Unauthorized'); header('WWW-Authenticate: Basic realm="Top Secret"');

    7. 執(zhí)行下載操作

    header('Content-Type: application/octet-stream'); //設(shè)置內(nèi)容類型 header('Content-Disposition: attachment; filename="example.zip"'); //設(shè)置MIME用戶作為附件 header('Content-Transfer-Encoding: binary'); //設(shè)置傳輸方式 header('Content-Length: '.filesize('example.zip')); //設(shè)置內(nèi)容長度

    想了解

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號