最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

php download.php實(shí)現(xiàn)代碼 跳轉(zhuǎn)到下載文件(response.redirect)

 更新時(shí)間:2009年08月26日 00:03:06   作者:  
一直對(duì)php不太熟悉,今天需要類型asp的 response.redirect語(yǔ)句,但一直沒(méi)有很好的解決方法。下面是問(wèn)了朋友才知道的。
跳轉(zhuǎn)核心代碼實(shí)現(xiàn)。
復(fù)制代碼 代碼如下:

if (isset($link))
                {
                    Header("HTTP/1.1 303 See Other");
                    Header("Location: $link");
                    exit;
                }



下面是國(guó)外的一篇文章說(shuō)明。
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.fzitv.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

相關(guān)文章

最新評(píng)論

于田县| 盱眙县| 佛教| 罗城| 晋宁县| 兖州市| 台北市| 岳阳市| 杨浦区| 曲松县| 黑山县| 崇信县| 松滋市| 中西区| 辉县市| 庆城县| 新巴尔虎左旗| 陆河县| 天气| 泰州市| 衡东县| 水富县| 阳高县| 上栗县| 正定县| 永吉县| 治县。| 松潘县| 东乡县| 高雄市| 乌什县| 连南| 山东| 乌苏市| 米脂县| 朝阳区| 兴宁市| 邹城市| 巢湖市| 康平县| 南投县|