i also have the code and its working. i just don't know how to combine the 2.
i checks for the email but still sends the message to the email because the other condition is correct.
pls. help me. thanks.
<?php
$problem = FALSE; //no problem
//check value
$themessage = "You are required to complete the following fields: ";
if (empty($fguess)){
$problem = TRUE;
$themessage.= 'First guess';
}
if (empty($sguess)){
$problem = TRUE;
$themessage.=',Second guess,';
}
if (empty($tguess)){
$problem = TRUE;
$themessage.=',Third guess';
}
if (empty($_POST['f_name'])){
$problem = TRUE;
$themessage.=',First Name';
}
if (empty($m_name)){
$problem = TRUE;
$themessage.=',Middle Name';
}
if (empty($l_name)){
$problem = TRUE;
$themessage.=',Last Name';
}
if (empty($h_address)){
$problem = TRUE;
$themessage.=',Home Address';
}
if (empty($email)){
$problem = TRUE;
$themessage.=',Email Address';
}
if (empty($contact)){
$problem = TRUE;
$themessage.=',Contact No';
}
if (empty($job)){
$problem = TRUE;
$themessage.=',Job Title';
}
//Print alert box with error message if there is a problem
if($problem) {
print("<script>alert('$themessage')</script>");
}
?>
here is the email checking
$emailchk = mysql_query("SELECT * FROM shinygame WHERE email = '$email'");
if(mysql_num_rows($emailchk) > 0) {
$error = 1;
}
if ($error)
{ print("<script>alert('Email is already registered, pls. try again.')</script>");
print "<script type=\"text/javascript\">";
print "window.location.href = 'game.php'";
print "</script>";
}
how do i combine the two codes to make it one.
Thank you!


Sign In
Create Account


Back to top









