Maison > Article > développement back-end > PHP重定向网页的具体实现方法介绍_PHP教程
对于初学者来说,PHP重定向网页方法一:
向页面发送http头信息实现重定向 以下为引用的内容:
PHP重定向网页方法二:
用javascript 脚本实现页面的重定向
以下为引用的内容:
<ol class="dp-xml"> <li class="alt"><span><span class="tag"><span> ?php </span></span></span></li> <li><span>echo " </span></li> <li class="alt"><span class="tag"><span> </span><span class="tag-name">script</span><span class="tag">></span><span class="attribute">window.location</span><span> = </span></span></li> <li><span>"$PHP_SELF"; </span></li> <li class="alt"><span class="tag"><span> /script</span><span class="tag">></span><span>"; </span></span></li> <li> <span class="tag">?></span><span> </span> </li> </ol>
PHP重定向网页方法三:
用html 的meta标签实现页面的重定向
以下为引用的内容:
<ol class="dp-xml"> <li class="alt"><span><span class="tag"><span> ?php </span></span></span></li> <li><span>echo " </span></li> <li class="alt"><span class="tag"><span class="tag-name">META</span><span> </span><span class="attribute">HTTP-EQUIV</span><span>= </span></span></li> <li> <span>"Refresh" </span><span class="attribute">CONTENT</span><span>="0; </span> </li> <li class="alt"> <span class="attribute">URL</span><span>=</span><span class="attribute-value">index</span><span>.php" </span> </li> <li> <span class="tag">></span><span>"; </span> </li> <li class="alt"> <span class="tag">?></span><span> </span> </li> </ol>