noob: how to show login error message on the same page after php server processes request
<p>I have a login page.
User first enters information and submits the form.  </p>

<p>And I have a php script that will see if the user exists.</p>

<pre><code>If( authenticated == true)  
{  
    // I do a redirect  
}  
else  
{  
  // I want to popup an error message on the same page.  
} 
</code></pre>

<p>1) I'm not sure how to show the popup message, 
 I would like to make my div element visible with an error message returned from the server,<br>
I would have to use Ajax, right?
But how?</p>

<p>Or are there alternatives which are just as good.</p>
