Home  >  Article  >  Backend Development  >  php页面重定向的有关问题

php页面重定向的有关问题

WBOY
WBOYOriginal
2016-06-13 12:53:03670browse

php页面重定向的问题
请问php页面重定向有哪些方式,对于通过传递id值而产生新的页面该怎么实现?

php?页面重定向 php
------解决方案--------------------
一、header("location: http://....");
注意点:1.header之前不能有其他输出。
2.header重定向后及时exit防止后续语句被执行。

二、HTML中的META
 
' "> 
 

三、写js
echo "<script>location.href='$url'</script>"; 

传递过来的变量直接附在url后即可传入下一页面,$url = 'http://xxx.com/a.php?a='."$a";
------解决方案--------------------
header("location: http://www.sina.com.cn/?a=1111");
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn