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.

    Well, as you've not told us anything about the registration form, the best help I can offer is that you can do it with a text editor and the copy/paste commands.

      Ashley Sheridan;11016587 wrote:

      Well, as you've not told us anything about the registration form, the best help I can offer is that you can do it with a text editor and the copy/paste commands.

      Thanks for ur response,

      I created the registration form and as well as email verification.Thats why i didnt post anything.

      thanks,
      simbu.

        Well, we really need to see something to advise you. You asked how to include one thing within another, but won't tell us what one of those things is. PHP isn't Photoshop, there's no magic button that will do stuff for you 😉

          Write a Reply...