title: $_POST Undefined index: Error
body: <p>The Form:</p>
  
  <pre><code>&lt;form action="/HW2/controllers/login.php" id = "login-box" method = "post"&gt;
          Username: &lt;input type="text" name='user'&gt;&lt;br&gt;
          Password: &lt;input type="text" name='pwd'&gt;&lt;br&gt;
          &lt;input type="submit"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>The Action:</p>
  
  <pre><code>&lt;?php
  require("../config/config.php");
  if(isset($_POST['user']) &amp;&amp; isset($_POST['pwd'])){
      if(strcmp($_POST['user'], USERNAME) == 0 &amp;&amp; strcmp($_POST['pwd'], 
          PASSWORD) == 0){
          session_start();
          $_SESSION['logon'] = true;
          echo "success";
          //header("location: /HW2/index.php?view=loggedin");
      }else{
          print_r("Sorry, your username and/or password are invalid. Try Again?");
          //header("location: /HW2/index.php?view=loginPage");
          }
  }else{
      print_r("Post data not sent.");
  }
  ?&gt;
  </code></pre>
  
  <p>I've tried numerous different approaches and all result in "Post data not sent."(aka "Undefined index:" if I try to access the $_POST values) Been trying to find what I messed up for a good few hours now, any help is appreciated, I'm a total scrub at php, it's likely something incredibly simple and stupid. </p>
  
  <p>Thanks in advance!</p>