Maison >développement back-end >tutoriel php >推荐几种PHP实现页面跳转的方法_PHP教程
1.PHP实现页面跳转第一种方法
header()是php内置函数,用于实现页面跳转。
2.PHP实现页面跳转第二种方法:利用
<ol class="dp-xml"> <li class="alt"><span><span>jsecho " </span></span></li> <li><span class="tag"><span> </span><span class="tag-name">script</span><span> </span><span class="attribute">language</span><span>=</span><span class="attribute-value">"javascript"</span><span class="tag">></span><span>"; </span></span></li> <li class="alt"> <span>echo "</span><span class="attribute">location.href</span><span>=</span><span class="attribute-value">'www.abidu.com'</span><span>"; </span> </li> <li><span>echo " </span></li> <li class="alt"><span class="tag"><span> /script</span><span class="tag">></span><span>"; </span></span></li> </ol>
3.PHP实现页面跳转第三种方法(利用HTML方法实现页面跳转,该方法较为实用,可以设置刷新时间,推荐使用。)
<ol class="dp-xml"> <li class="alt"><span><span>echo </span></span></li> <li> <span> ("</span><span class="attribute">http-equiv</span><span>='refresh'<br></span><span class="attribute-value">content</span><span>=0;</span><span class="attribute">URl</span><span>=</span><span class="attribute-value">'hehe.html'</span><span>"); </span> </li> </ol>
1.若是跳转到其它页面可以加上参数 index.php?id=4action=add2.取出其它页面以后参数
<ol class="dp-xml"> <li class="alt"><span><span>$</span><span class="attribute">id</span><span> = $_GET[id]; </span></span></li> <li class="alt"><span><span>$</span><span class="attribute">action</span><span>=$_GET[action]; </span></span></li> </ol>
以上就是PHP实现页面跳转的具体方法。