title: How to create a login form with HTML, PHP and MySQL
body: <p>UPDATE [13.10.16]</p>
  
  <p>So coming back to one of my previous questions on stackoverflow that has low reputation and for reasons I can see why, I wanted to update it and make it much more relevant.</p>
  
  <p>When I wrote this question I wanted to create a login system from a basic html form, it is a much more complicate process.</p>
  
  <p>For anyone seeing this question I would recommend that you use a PHP framework that does all the handling for you. I would suggest using Laravel as it has all the framework you need for a simple login system and much more without the need of lots of PHP which would be needed for the example below.</p>
  
  <hr>
  
  <p>Original Question</p>
  
  <p>How do I create a login form with HTMl, PHP, and MySQL?</p>
  
  <p>I created a form as seen below:</p>
  
  <pre><code>&lt;form id="login"&gt;
  
  
      &lt;h2 id="logintxt"&gt;Log In&lt;/h2&gt;
      &lt;h1 id="username"&gt;User Name:&lt;/h1&gt;
      &lt;input name="Username" type="text" value="" maxlength="20" id="usernamebox" /&gt;
      &lt;h1 id="password"&gt;Password:&lt;/h1&gt;
      &lt;input name="Password" type="password" id="passwordtxt" /&gt;
      &lt;h1 id="forgot"&gt;Forgot Password&lt;/h1&gt;
      &lt;h1 id="register"&gt;Register&lt;/h1&gt;
      &lt;div id="submit"&gt;
      &lt;img src="login.gif" width="100" height="40" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>I have seen tutorials when having a form navigate to another page to login however I do not like this is there any way around it?</p>
  
  <p>My MySQl data is:</p>
  
  <pre><code>Host: localhost
  Username: root
  Password: root
  Database: the_tech
  </code></pre>
  
  <p>Thanks</p>
  
  <p>[UPDATE]</p>
  
  <p>Here is my full html page. <a href="http://pastebin.com/NvgzT0Xu" rel="nofollow">http://pastebin.com/NvgzT0Xu</a></p>
  
  <p>From this what is required to create a html page login? Preferably without leaving the page.</p>
  
  <p>I tried adding this (<a href="http://pastebin.com/1HcZGsUS" rel="nofollow">http://pastebin.com/1HcZGsUS</a>) to the top of my page however it did not work. I was following this (<a href="https://www.scirra.com/tutorials/525/simple-login-using-a-mysql-database" rel="nofollow">https://www.scirra.com/tutorials/525/simple-login-using-a-mysql-database</a>) tutorial.</p>
  
  <p>Thanks</p>