title: Redirecting a page automatically in PHP
body: <p>I want to redirect a page automatically in PHP</p>
  
  <p>Logout.php:</p>
  
  <pre><code>&lt;?php 
    include "base.php"; 
    $_SESSION = array(); session_destroy();
  ?&gt;
  &lt;meta http-equiv="refresh" content="=0;URL=index.php" /&gt;
  </code></pre>
  
  <p>Where base.php calls the database and starts the session:</p>
  
  <pre><code>&lt;?php
    session_start();  
    $dbhost = "localhost";
    $dbname = "login";
    $dbuser = "root";
    $dbpass = "";
    mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());  
    mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());  
  ?&gt;  
  </code></pre>
  
  <p>When pressing logout, I am not getting back to <code>index.php</code>.</p>