title: http.server - Unsupported method ('POST')
body: <p>So I have created a website, when the user tries to fill out the login form (username and password), the following error message is displayed:</p>
  
  <pre><code>Error response
  Error code: 501
  
  Message: Unsupported method ('POST').
  
  Error code explanation: HTTPStatus.NOT_IMPLEMENTED - Server does not support this operation.
  </code></pre>
  
  <p>For the server im using Python 3 <a href="https://docs.python.org/3/library/http.server.html" rel="noreferrer">http.server</a>. To start the server i have a batch file containing the following code:</p>
  
  <pre><code>python -m http.server 80
  </code></pre>
  
  <p>I'm looking for a way to receive the login credentials the user submitted, and store them in a text file (.txt). </p>
  
  <p>After doing some research I got the impression I need to create a PHP script, i have no idea how to do this. here is my attempt at it:</p>
  
  <pre><code>&lt;?php
  $username = htmlspecialchars($_POST['username']);
  $password = htmlspecialchars($_POST['password']);
  
  echo $username, ' ', $password;
  ?&gt;
  </code></pre>