<p>Case 1 : Redirect a page to a URL without waiting in PHP.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p>1</p>
</td>
<td>
<p>
</p>
<p><code>header(</code><code>"Location: index.php"</code><code>);</code></p>
</td>
</tr>
</tbody>
</table>
<p>Case 2 : Redirect a page to an URL after waiting for X seconds in PHP.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
</td>
<td>
<p>
</p>
<p><code><?php</code></p>
<p><code>header(</code><code>"Refresh: 5; url=index.php"</code><code>);</code></p>
<p><code>echo</code> <code>'Logged in successfully.'</code><code>; ?></code></p>
</td>
</tr>
</tbody>
</table>
<p> HTML code to redirect a webpage after X seconds.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p>1</p>
</td>
<td>
<p>
</p>
<p><code><</code><code>meta</code> <code>http-equiv</code><code>=</code><code>"refresh"</code> <code>content</code><code>=</code><code>"5; url=http://sau.comli.com/"</code><code>></code></p>
</td>
</tr>
</tbody>
</table>
<p>
以上就介绍了Header() in PHP &html – Refresh (Redirect) to Location (URL) in X seconds,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。</p>
<p>
</p>
Statement of this Website
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