Jquery远程方法无法正常工作

I am new to jquery.. as form validation i am using the following form validation code..

just i added the remote method to check the email existance.. but it always saying the email is "already exist"

Here is the snippet of the code...

<script>
$(document).ready(function(){
    $("#f2").validate({
        debug: false,
        rules: {    
            email: {
                required:true,
                email:true,
                remote:'checkemail.php'
            },
            comments: {
                required:true
            }
        },
        messages:
        {
            email:{
                required:"Please enter valid email",
                remote:"Already Exist"
            }
        }});
});
</script>

Here is the form code..

   <form  name="f2" id="f2" method="post" action="">
       <div>
        <label >Email</label>
        <input type="text" name="email">
     </div>
    </form>

Here is the checkemail.php code..

<?php
    $email=$_GET['email'];
    $query="select email from emails where email='$email'";
    $res=  mysql_query($query);
    $cou=  mysql_num_rows($res);
    if($cou>0)
    {
        echo "true";
    }
    else{
        echo "false";
    }
?>

Update

i missed the db connection.. After putting the db connection in checkemail.php file, the remote method is not showing any message.. and form is submitting without checking the email is already exist why?

why the form behaving like this? Any idea..

Any suggestions are welcome...

Modify you if statement like this if($cou>0) { echo 'false'; } else{ echo 'true'; }

I went through a similar kind of situation few days back and I have fixed the issue. In the user form I have to check for duplicate username using remote. My form field for user looks like

Then I used the validator script as

$('#addRecord').validate({
    ignore:"",
    rules : {
    user_name : {
    required :1,
    minlength :3,
    remote :"check_unique.php?field=user_name&action=add"
    },

firstname : {
    required :1,
    },
lastname : {
    required :1,
    },
email : {
    required :1,
    },

}, 

In the check_unique.php I have similar as yours the only thing I did as

echo json_encode(true); or echo json_encode(false);

Try using json_encode to your true or false and it should solve the issue.