Home > Article > Backend Development > Introduction to the specific implementation method of redirecting web pages in PHP_PHP tutorial
For beginners, PHP Redirect Web Page Method 1:
Send http header information to the page to implement redirection. The following are quoted Content:
PHP redirect web page method two:
Use javascript script to redirect the page
The following is the quoted content:
<ol class="dp-xml"> <li class="alt"><span><span class="tag"><</span><span> ?php </span></span></li><li><span>echo " </span></li><li class="alt"><span class="tag"><</span><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><span> /script</span><span class="tag">></span><span>"; </span> </li> <li> <span class="tag">?></span><span> </span> </li> </ol>
PHP method three for redirecting web pages:
Use html meta tags to redirect pages
The following is the quoted content:
<ol class="dp-xml"> <li class="alt"><span><span class="tag"><</span><span> ?php </span></span></li><li><span>echo " </span></li><li class="alt"><span class="tag"><</span><span class="tag-name">META</span><span> </span><span class="attribute">HTTP-EQUIV</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></span></li> <li class="alt"> <span class="tag">?></span><span> </span> </li> </ol>