色尼玛亚洲综合影院,亚洲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),轉載需保留來源!

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

主站蜘蛛池模板: 伽师县| 迁西县| 射阳县| 吉木萨尔县| 图们市| 长寿区| 桂阳县| 惠来县| 仙居县| 东明县| 陆良县| 大竹县| 麻城市| 乌拉特前旗| 武穴市| 屏边| 玛曲县| 天全县| 南和县| 维西| 淮安市| 遂宁市| 弥勒县| 巴林左旗| 法库县| 册亨县| 加查县| 台北县| 乳山市| 绥江县| 旺苍县| 乌什县| 大方县| 罗定市| 文成县| 班玛县| 安陆市| 定结县| 珠海市| 苏尼特左旗| 康乐县|