Efficient JQuery login script
<p>I have been able to create a login form using 2 different methods.</p>

<p>1) Use $.POST to send password to server PHP script which returns a success true flag. The form then needs to be submitted a second time so PHP 'header' can be called to load a new page  (this has the ajax advantage that an error message can be faded in if success flag returns false).</p>

<p>2)  Use JQuery Submit allowing the server PHP 'header' to redirect to a new page on first submission. However if the password is incorrect there is no way to pick up a returned value and fade in an error message - a complete new page needs to be loaded.</p>

<p>Is there anyway of getting the best of both worlds, i.e. $.POST function or PHP 'header' can be made to direct to a new page on first submission OR Submit can pick up a return value?</p>
