Jump to content

check email doesnt exist already


matttherat

Recommended Posts

Hi. am new to php. followed a tutorial to do an email verification but it isnt set to check the db for exisiting emails. want it so only one email can be registered per person. can anyone help?

 

If u want to see my code see attached file

 

 

Something like the following should work for you. You may want to tweak it.

 

$check = mysql_query("SELECT email FROM temp_members_db WHERE email = '$email'")
$check2 = mysql_num_rows($check);

//if the name exists it gives an error
if ($check2 != 0) {
header("refresh: 5; signup_ac.php");
die('Sorry, the email <b>'. $email .'</b> is already in use.');
}

Hi. am new to php. followed a tutorial to do an email verification but it isnt set to check the db for exisiting emails. want it so only one email can be registered per person. can anyone help?

 

If u want to see my code see attached file

 

 

Something like the following should work for you. You may want to tweak it.

 

$check = mysql_query("SELECT email FROM temp_members_db WHERE email = '$email'")
$check2 = mysql_num_rows($check);

//if the name exists it gives an error
if ($check2 != 0) {
header("refresh: 5; signup_ac.php");
die('Sorry, the email <b>'. $email .'</b> is already in use.');
}

 

 

Hi. thanks. that looks pretty good but not really working. It just seems to have a blank page.it is working as in it doesnt send the info to the database. Just want it so it also redirects to a new page say bla.html. any ideas?

it doesnt send the info to the database.

 

Did you change the field and table names to match yours?

 

Just want it so it also redirects to a new page say bla.html. any ideas?

 

he does that, just change signup_ac.php to your desired redirect location like:

header(refresh:5; url='blah.html');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.