using ajax to create an authentication app but no return is being put
<p>when i click post the post response that i am getting from firefox is: (when i enter k for username)</p>

<p>password 
username k</p>

<p>Source: username=k&amp;password=</p>

<p>the print received from the php wont display in the #errorshow div</p>

<p>here is my code
(html)</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;


$(function() {

 $("#login_form").submit(function() {


 var uname = $("#username").val();
 var upass = $("#password").val();
 $.post("auth.php", { username: uname, password: upass}, function(data) {
 $("#errorshow").html(data);

 });

 return false;


 });

 });



&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="login_form" method="post"&gt;
&lt;p&gt;Username: &lt;input type="text" id="username" /&gt;&lt;/p&gt;
&lt;p&gt;Password: &lt;input type="password" id="password" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;input type="submit" value="Login" /&gt;&lt;/p&gt;
&lt;/form&gt;
&lt;div id="errorshow"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>here is the php (auth.php)</p>

<pre><code>&lt;?php
mysql_connect("","","") or die(mysql_error());
mysql_select_db("") or die(mysql_error());

$username = $_POST['username'];
$password = $_POST['password'];



$query = mysql_query("select username,password,active,role from tbl_logins where username = '$username'") or die(mysql_error());
 while($row = mysql_fetch_assoc($query)) {

 // CHECK FOR EMPTY FIELDS
    if(empty($username) || empty($password)) {
    print "the username or password is empty";
    }




    //CHECK FOR USERNAME EXISTANCE
    elseif($db-&gt;num_rows($query) == 0) {
 print "the username you entered doesnt exist";
 }


    //CHECK FOR PASSWORD IS CORRECT
    elseif(sha1($password) != $row['password']) {
 print "the password you entered is incorrect";
 }


     //CHECK IF ACCOUNT IS ACTIVE
     elseif($row['active'] == 'no') {
     print "your account is not active. please verify your email";
  }


 else {

 //create cookie and login user.

 $_SESSION['AUTHID'] = sha1($row['hash']);

 //routh to appropriate role section
 if($row['role'] == "0") {
 $_SESSION['error'] = "";
 header("Location: /_admin/dashboard.php");
 } else {
 $_SESSION['error'] = "";
 header("Location: /worldex/_members/index.php");
 }

 }//end else


 } //end while


?&gt;
</code></pre>
