title: Javascript form, send values to PHP and retrieve it
body: <p>I'm trying to be the clearest possible.</p>
  
  <p>Basically,I need a login using JavaScript in HTML page only. This because I have to use html pages only. I have a html form like below: </p>
  
  <pre><code>&lt;form id="privateform" method="post" action="post.php"&gt;&lt;label&gt;insert password&lt;/label&gt;
     &lt;input type="password" id="password" name="password"&gt;
     &lt;input type="submit" value="Login"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I need that if ( password submitted === password read from database by PHP) user is redirected to next page ON THE HTML page. How can I achieve this? Since what i'm having as result that my html page wants to save PHP result as JSON file..</p>