title: PHP login script 404 error
body: <p>I used a login script tutorial here: <a href="http://www.astahost.com/info/tilltf-simple-login-script-simple-secure-login-script.html" rel="nofollow">http://www.astahost.com/info/tilltf-simple-login-script-simple-secure-login-script.html</a> and when I clocked login, there was a 404. When i went back, I was logged in. I followed the the tutorial exactly as it said. Any idea why it is going to this weird page?</p>
  
  <pre><code>    &lt;?php
  
  session_start();
  require_once 'database.php';
  if (isset($_SESSION['user'])){
  
  echo "Welcome ".$_SESSION['user'];
  
  ?&gt;
  
  &lt;form name="logout" method="post" action="logout.php"&gt;
  
  &lt;input type="submit" name="logout" id="logout" value="Logout"&gt;
  
  &lt;/form&gt;
  
  &lt;br /&gt;&lt;form name="news" method="post" action="news.php"&gt;
  
   &lt;input type="submit" name="news" id="news" value="News"&gt;
  
  &lt;/form&gt;
  
  &lt;?php
  
  }
  
  elseif(isset($_SESSION['admin'])){
  
  echo"Welcome ".$_SESSION['admin'];
  
  echo"&lt;br&gt;&lt;br&gt;You are logged in as an Admin";
  
  ?&gt;
  
  &lt;form name="logout" method="post" action="logout.php"&gt;
  
  &lt;input type="submit" name="logout" id="logout" value="Logout"&gt;
  
  &lt;/form&gt;
  
  
  
  &lt;/form&gt;
  
  &lt;?php
  
  }else{
  
  ?&gt;
  
  &lt;form name="login_form" method="post" action="login2.php"&gt;
  
   &lt;label&gt;
  
   &lt;input name="user" type="text" id="user"&gt;ID&lt;br /&gt;
  
   &lt;input name="pass" type="password" id="pass"&gt;Password&lt;br /&gt;
  
   &lt;/label&gt;
  
   &lt;input type="submit" name="login" id="login" action="index.php" value="Login"&gt;
  
   &lt;/label&gt;
  
   &lt;/p&gt;
  
  &lt;/form&gt;
  
  &lt;form name="Register" method="post" action="reg.php"&gt;
  
   &lt;input type="submit" name="register" id="register" value="Register"&gt;
  
  &lt;/form&gt;&lt;br /&gt;
  
  &lt;form name="news" method="post" action="news.php"&gt;
  
   &lt;input type="submit" name="news" id="news" value="News"&gt;
  
  &lt;/form&gt;
  
  &lt;?php
  
   }
  
   ?&gt;
  </code></pre>