E-Newsletter Archive
Please check back this spring to download the first addition of our E-Newsletter!
Subscribe
$value) { $clean[$key]=mysql_real_escape_string($value); } //Set Varibles form post $firstname=$clean['firstname']; $lastname=$clean['lastname']; $email=$clean['email']; //Check if all values are filled in if ($firstname == "") { echo "You forgot to enter your first name
"; exit; } if ($lastname == "") { echo "
You forgot to enter your first name
"; exit; } if ($email == "") { echo "
You forgot to enter your email
";
exit;
}
//see if already in database
$sql = "SELECT * FROM contacts WHERE email = '$email';";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{ // Already In Database
echo "Sorry Our records show that you already have sign up for our newsletter.
Thank you for your intrest intrest in our company";
exit;
}
else
{
$sql = "INSERT INTO `contacts` (`lastname`, `firstname`, `email`) VALUES ('$lastname', '$firstname', '$email');";
$result=mysql_query($sql) or die(mysql_error());
// if suceesfully inserted data into database, send confirmation link to email
if($result)
{
// ---------------- SEND MAIL FORM ----------------
// send e-mail to ...
$to=$email;
// Your subject
//$subject="Please Confirm Email To Finish Contest Entry";
$subject="Thank you for signing up for our E-Newsletter";
// From
$header="from: B&B Floor CoveringsWow This is embaressing
";
echo "There seems to be an error on our web site";
echo "Please Contact B&B Floor Coverings";
}
// if your email succesfully sent
if($sentmail){
// header( 'Location: http://www.bbfloor.com/enter.html' ) ;
echo "Thank you $firstname ,
You have been entered into our E-Newsletter mailing list.";
}
else
{
echo "Wow This is embaressing
";
echo "There seems to be an error on our web site";
echo "Please Contact B&B Floor Coverings";
}
}
}
else
{ //action on normal page load
echo" ";
}
?>
