title: upon execution of my log in page i receive error message 404, how do i solve this?
body: <p>i have sucessfully created a sign up page however i am now trying to create a log in page using php and PDO, the form on the html side of things i have no issue with however when it comes to the php side i seem to be doing something wrong as i am greeted with error 404 upon submission of log in information...this is the code: </p>
  
  <pre><code>&lt;?php
  session_start();
  $errmsg_arr = array();
  $errflag = false;
  
  //configuration
  $server = "127.0.0.1";
  $dbusername = "root";
  $dbpassword = "";
  $db="movie1";
  
  // Database connection
  try {
      $handle = new PDO("mysql:host=$server;dbname=$db", "$dbusername", "$dbpassword");
      $handle-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      echo "connected";
  } catch (PDOException $e) {
      die("something failed");
  }
  
  // new data
  $user = $_POST['username'];
  $password = $_POST['password'];
  
  if($user == '') {
      $errmsg_arr[] = 'username required'
          $errflag = true;
  }
  
  if($password == ''){
      $errmsg_arr[] = ' password required';
      $errflag = true;
  }
   // query
  
  $result = $handle-&gt;prepare("SELECT * FROM user WHERE username= ? AND password = ?");
  $result-&gt;bindParam('?', $user);
  $result-&gt;bindParam('?', $password);
  $result-&gt;execute();
  $rows = $result-&gt;fetch(PDO::FETCH_NUM);
  if ($rows &gt; 0) {
      header("location: home.php");
  }
  else{
      $errmsg_arr[]= 'Username and password not found';
      $errflag = true;
  }
  if($errflag) {
      $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
      session_write_close();
      header("location:index.php");
      exit();
  }
  
  ?&gt;
  </code></pre>
  
  <p>and this is the html code :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;log in&lt;/title&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"&gt;
  &lt;body&gt;
  
  &lt;form class="w3-container w3-card-4" action="login.php" method="post"&gt;
      &lt;h2 class="w3-text-black"&gt;Log in&lt;/h2&gt;
      &lt;p&gt;Log in&lt;/p&gt;
      &lt;p&gt;
          &lt;label class="w3-text-black"&gt;&lt;b&gt;username&lt;/b&gt;&lt;/label&gt;
          &lt;input class="w3-input w3-border" name="username" type="text" placeholder="username"&gt;&lt;/p&gt;
      &lt;p&gt;
          &lt;label class="w3-text-black"&gt;&lt;b&gt;Password&lt;/b&gt;&lt;/label&gt;
          &lt;input class="w3-input w3-border" name="password" type="text" placeholder="password"&gt;&lt;/p&gt;
  
      &lt;p&gt;
          &lt;button class="w3-btn w3-black"&gt;Log in&lt;/button&gt;&lt;/p&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>however once I enter the correct log in information and submit the form I and greeted by error 404, where am I going wrong?</p>