title: how to stop the back button after the user press logout
body: <p>login.php
  I just want to prevent the user after the user logout and press the back button he will still logout... in the current state of my project after the user logout and press back button he will go back in the last page and still log in</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
   &lt;html&gt;
    &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=MS932"&gt;
       &lt;title&gt;Login Page&lt;/title&gt;
     &lt;link rel ="stylesheet" type="text/css" href="style.css"&gt;
  &lt;/head&gt;
  
   &lt;body&gt;
  &lt;div id ="frm"&gt;
  &lt;form action="process.php" method="post" &gt;
     &lt;p&gt;
            &lt;label&gt;Username:&lt;/label&gt;
            &lt;input type="text" id="email" name="user" required/&gt;
     &lt;/p&gt;
     &lt;p&gt;
            &lt;label&gt;Password:&lt;/label&gt;
            &lt;input type="password" id="pass" name="pass" required/&gt;
     &lt;/p&gt;
     &lt;p&gt;
  
            &lt;input type="submit" id="btn" value="Login"/&gt;
     &lt;/p&gt;
  
  
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>process.php</p>
  
  <pre><code>  &lt;?php 
   $username = $_POST['user'];
   $password = $_POST['pass'];
  
    $username = stripcslashes($username);
    $password = stripcslashes($password);
    $username = mysql_real_escape_string($username);
    $password = mysql_real_escape_string($password);
  
   mysql_connect("localhost","root","");
    mysql_select_db("testproduct");
  
    $result = mysql_query("SELECT * FROM tbluser where email = '$username' and  pass='$password'")or  die("Failed to query database".mysql_error());
  $row = mysql_fetch_array($result);
    if($row['email'] == $username &amp;&amp; $row['pass'] == $password){
  echo "&lt;script&gt;window.location.assign('index.php');&lt;/script&gt;";
   }else{
  
     echo "&lt;script&gt;alert('Login was unsuccessful, please check your username   and password')&lt;/script&gt;";
     echo "&lt;script&gt;window.location.assign('login.php');&lt;/script&gt;";
     return false;
   }
   ?&gt; 
  </code></pre>
  
  <p>logout.php</p>
  
  <pre><code>  &lt;?php 
    session_start();
   session_destroy();
   $_SESSION = array();
   header("location: login.php");
    ?&gt;
  </code></pre>