How to stop redirection in Php if validation is failed?
<p>I am having problem in signup.php page. I want if information is already existing in database then this page should stop redirecting to next page and show alert box. Now the problem is I tried the following code snippet of jquery but this did not work in my case.I googled about this and come with the following solution but this did not work.</p>

<p><strong>Jquery Code</strong></p>

<pre><code>function validate()
{
    var email =$('#email').val();
    var mobile = $('#mobile').val();

    $.post("check_user.php",{ email: email,mobile:mobile}, function(result){
        if(result == "0"){
            alert('This email is already registered with us. Please try another.');
            return false;
        }
        else
        {
            return true;
        }
    });
}
</code></pre>

<p>Html code is given below where I am calling this jquery function</p>

<p><strong>HTML Code</strong></p>

<pre><code>&lt;form id="form1" autocomplete="on" action='/marammut_new/test.php'
method="post" enctype="multipart/form-data" onsubmit="return validate()"&gt; 
...
&lt;/form&gt;
</code></pre>