欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

PHP中用header的具体使用技巧

程序员文章站 2022-05-25 09:10:25
...
我们在1、location和“:”号间不能有空格,否则会出错。

2、在用header前不能有任何的输出。

3、PHP中用header后的PHP代码还会被执行。

下面是和asp中重定向response.redirect的比较:

例1:

response.redirect "../test.asp"

header("location:../test.php");

两者区别:

asp的redirect函数可以在向客户发送头文件后起作用.

  1. html>head>head>body>
  2. %response.redirect "../test.asp"%>