my index page

<script type="text/javascript">
$(document).ready(function(){
$("#first_name").blur(function() {
var first_name = $('#first_name').val();
var fathermobile = $('#fathermobile').val();
if(first_name=="")
{
$("#disp").html("");
}
else
{
$.ajax({
type: "POST",
url: "detail.php",
data: 'first_name='+ first_name +'fathermobile='+fathermobile,
success: function(html){
$("#disp").html(html);

}
});
return false;
}
});
});

and my detail.php

<?php
include("include/connect.php");  
if(isset($_POST['first_name']) && isset($_POST['fathermobile']) )
{


$first_name=mysql_real_escape_string($_POST['first_name']);
$fathermobile=mysql_real_escape_string($_POST['fathermobile']);
$query=mysql_query("select * from  candidate where  first_name='$first_name'");
$row=mysql_num_rows($query);
if($row==0)
{
echo "<span style='color:green;'>Please Continue..</span>";
}
else
{
echo "<span style='color:red;'>Already Registered</span>";

}
}

?>

Please help me i am not getting data with multiple varibles in detail page

Member Avatar for diafol

The 'data' string parameter doesn't look right:

data: 'first_name='+ first_name +'fathermobile='+fathermobile,

Try

data: 'first_name=' + first_name + '&fathermobile=' + fathermobile,    

Alternatively...

data: {first_name: first_name, fathermobile: fathermobile},

Very Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.