php页面重定向的问题
请问php页面重定向有哪些方式,对于通过传递id值而产生新的页面该怎么实现?
+本文来源gao@daima#com搞(%代@#码网
搞代gaodaima码
php?页面重定向 php
——解决方案——————–
一、header(“location: http://….”);
注意点:1.header之前不能有其他输出。
2.header重定向后及时exit防止后续语句被执行。
二、HTML中的META
<meta HTTP-EQUIV=”REFRESH” CONTENT=”5; URL='<?php echo $url;?>’ “>
三、写js
echo “<script language=\”JavaScript\”>location.href=’$url'</script>”;
传递过来的变量直接附在url后即可传入下一页面,$url = ‘http://xxx.com/a.php?a=’.”$a”;
——解决方案——————–
header(“location: http://www.sina.com.cn/?a=1111”);