Hi all,
I have written the following script and wish to add in a part to make sure the email is not a duplicate.
Im a bit unsure as when i added in an sql clause to check_num_rows after the "isset" it just ignored the check.
Heres the code
<?php
session_start();
include "connect.php";
if(isset($_POST['register']))
{
// I TRIED ADDING AN SQL STATEMENT HERE BUT IT WAS JUST IGNORED///
if (isValidEmail($_POST['email'])){
$name ='';
$email='';
$nationality='';
$name = $_POST['name'];
$email = $_POST['email'];
$nationality = $_POST['country'];
$SQL = "INSERT INTO tbl_beta (name, email, nationality) VALUES ('$name', '$email', '$nationality')";
$result = mysql_db_query($db,$SQL,$cid);
echo "Thanks for registering " . $name;
echo "<br>We will be in touch shortly.";
$_SESSION['betaemail'] = $email;
include "mail.php";
exit();
}else {echo "please enter a valid email address";}
}
?>