title: if ($_SERVER['REQUEST_METHOD'] === 'POST') doesn't seem to work
body: <p>I got this code, in login.php:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;login.php&lt;/title&gt;
  &lt;charset="utf8" /&gt;
  
  &lt;?php
  if ($_SERVER['REQUEST_METHOD'] === 'POST')
  {
      echo "It works!";
  }
  ?&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;h1&gt;Log in:&lt;/h1&gt;
  &lt;form method="POST" action="login.php" autocomplete="off"&gt;
  Username: &lt;input type="text" name="username" required="required" /&gt; &lt;br /&gt;
  Password: &lt;input type="password" name="password" required="required" /&gt; &lt;br/&gt;
  &lt;input type="submit" value="Login" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am a php beginner, and I am trying to post data to the same page. After testing I discovered that the php did execute, but didn't echo "It works".</p>
  
  <p>Any help for this is appreciated.</p>