Hello,
I want to check the email validate from database in the same registration form?
Here is my coding....It checks from database and shows the result but i need to include this coding in the registration form.Let me know how to do?
<?php
// connection to MySQL server
mysql_connect('localhost','','');
mysql_select_db('han');
// User input
$email = $_POST["email"];
// Construct and run query.
$sql = ("SELECT email FROM form WHERE email='$email'")or die(mysql_error());
$result = mysql_query($sql);
// If there is a user, log them in.
if(mysql_num_rows($result) > 0)
{
$_SESSION['login'] = true;
echo "Email already exist , please try different one";
}
else
die('Email not in use u can use it');
?>
thanks,
simbu.