色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php download.php實現代碼 跳轉到下載文件(response.redirect)

跳轉核心代碼實現。
復制代碼 代碼如下:
if (isset($link))
                {
                    Header("HTTP/1.1 303 See Other");
                    Header("Location: $link");
                    exit;
                }



下面是國外的一篇文章說明。
Hey Chris:
On Wed, Jan 26, 2005 at 12:28:19PM -0500, csnyder wrote:
>
> <?php
> // process form
> ...
> // redirect to results page
> header( 'HTTP/1.1 303 See Other' );
> header( 'Location: result.html' );
> exit( 'Form submitted, <a href="result.html">continue</a>.' );
> ?>
Good point. But some feedback here. The optimail syntax is:
<?php
// process form
// ...
// redirect to results page
header('Status: 303 See Other' );
header('Location: http://www.jb51.NET/result.html');
?>
Here's why...
Using "Status:" in the header is better because the resulting headers from
Apache are more correct:
HTTP/1.1 303 See Other
instead of
HTTP/1.1 303
Additionally, one doesn't really know which version of HTTP is being used,
so why potentially cause problems by trying to guess.
The specs say location headers must have a complete URI in them, not just
the path.
Lastly, you don't want any output after the location header.
Later,
--Dan

php技術php download.php實現代碼 跳轉到下載文件(response.redirect),轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 石首市| 德江县| 萨嘎县| 静宁县| 永安市| 阳新县| 凯里市| 长泰县| 建瓯市| 九江市| 五华县| 公主岭市| 阜新| 宁城县| 兴化市| 汝阳县| 新和县| 湾仔区| 溧水县| 浮山县| 长治市| 柳江县| 原阳县| 武胜县| 颍上县| 太谷县| 长顺县| 卢湾区| 莱阳市| 玛沁县| 茂名市| 卢龙县| 德昌县| 涿鹿县| 安溪县| 南安市| 鄢陵县| 华安县| 龙井市| 秭归县| 宜都市|