THANKS FOR AL LYOUR HELP GUYS
I've added the below code into the emial_check.php file and if you enter a valid email address you are directed to the jcorrect.php file.... this is correct.
within this jcorrect.php file i have this (below) code to add the first name and email adddress to my database, but this does not happen. do i need to pass the date from the two text boxes on the first page, the the email_check.php file, then check the email and if ok go to jcorrect.php where it should then load the first name and email address into the database.
<?php
//----------------- Ipdate Database --------------
//mysql_connect("localhost","USERNAME","PASSWORD") or die(mysql_error());
$connect = mysql_connect("localhost","USERNAME","PASSWORD") or die(mysql_error());
//mysql_select_db("TABLENAME", $connect);
mysql_select_db("DATABASE", $connect) or die(mysql_error());
//$sql = 'INSERT INTO `B_requests` (`Fname`, `Email`) VALUES (\'$Fname\', \'$Email\');';
$sql = mysql_query("INSERT INTO `B_requests` (`Fname`, `Email`) VALUES ('$Fname', '$Email')");
if (!$sql) { echo mysql_error(); }
// ---------------- SEND MAIL FORM ----------------
// send e-mail to
$to = $Email;
// Your subject
$subject="From www.MYSITE.com";
// Message
$message="Thank you for registering your details, we will send you a free online brochure shortly. ";
// From - $header="From: Your-Name <info@MYSITE.com>";
$header="From: <info@MYSITE.com>";
// send email
$sentmail = mail($to,$subject,$message,$header);
// error handeling
if($sentmail){
echo "Acknowledgement email sent";
}else{
echo "Cannot send Confirmation e-mail";
}
?>