title: Return After Failed Login Attempt PHP
body: <p>I am developing login form In PHP
  The form is as follows</p>
  
  <pre><code>&lt;form method="post" action="Login.php" id="Log"&gt;
  &lt;select id="Login" name="Type"&gt;
  &lt;option value="Sel" selected="selected"&gt;Select Login type&lt;/option&gt;
  &lt;option value="Student"&gt;Student&lt;/option&gt;
  &lt;option value="Faculity"&gt;Faculity&lt;/option&gt;
  &lt;/select&gt;
  &lt;div id="type"&gt;
  &lt;p id="Ch"&gt;Group Id: &amp;nbsp;&lt;input id="l" name="log" type="text"/&gt;&lt;/p&gt;
  &lt;p id="Pass"&gt;Password: &amp;nbsp; &lt;input id="p" name="Pass" type="password" /&gt;&lt;/p&gt;
  &lt;input id="Cond" type="Text" /&gt;
  &lt;input type="submit" value="Login"  /&gt;
  &lt;p id="Invalid" style="padding-top:.75em; color:#FF0000;"&gt;Invalid Login Or Password&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In post.php I connect with database and check login and passwords.</p>
  
  <p>I want to show the <code>&lt;p id="invalid"&gt;</code> tag when password or login don't match in the same form below it without any delay.</p>
  
  <p>The <code>&lt;p id="invalid"&gt;</code> is hidden at the beginning and only be shown when login or pasword is incorrect</p>
  
  <p>How can I achieve this/ connect with database through PHP? </p>