I am using this below code for check customer exist in database or not. it's working fine but it reload the page. can anyone suggest some ajax for reloading
<script type="text/javascript">
function emailcheck(email){
document.getElementById("myform").submit();
}
</script>
<?php //print_r($_POST['email']);
echo $email=$_POST['email'];
$con = mysql_connect("localhost","root","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("magento", $con);
$sql = "SELECT `email` FROM `customer_entity` WHERE `email`='".$email."'" or die(mysql_error());
$select = mysql_query($sql,$con);
$result=mysql_fetch_array($select);
echo $row = mysql_num_rows($select);
if ($row > 0)
{
echo 'This email Id is already exixst';
}
else
{
echo 'unavailable';
}
?>
<form id="myform" name ="myform" method="POST">
<input STYLE="WIDTH: 68%;MARGIN-LEFT: 12%;background-color: white;" placeholder="Email Address" type="email" name="email" id= "email" class="input-text " required />
<button class="button" onclick="emailcheck();"/> <span><span><?php echo $this->__('Submit') ?></span></span> </button>
</form>