$temp) { $_POST[$tempRowNumber] = str_replace("\\", "", $_POST[$tempRowNumber]); $_POST[$tempRowNumber] = str_replace("\"", """, $_POST[$tempRowNumber]); } ?> A Request Info Form with more form objects.

Request Information from the Acme Company

About You
First Name:*  * = Required
Last Name:*
Email:*
Interests
Favorite Characters: Bugs Bunny
"); if($_POST['contactDaffy'] == "YES") { $cbvalue = "checked"; } else { $cbvalue = "unchecked"; } echo("Daffy Duck
"); if($_POST['contactRoadRunner'] == "YES") { $cbvalue = "checked"; } else { $cbvalue = "unchecked"; } echo("Road Runner
"); if($_POST['contactCoyote'] == "YES") { $cbvalue = "checked"; } else { $cbvalue = "unchecked"; } echo("Wiley Coyote"); ?>
Age Group:
Please add to me to your mailing list: YES
No"); } elseif ($_POST['contactAddMailingList'] == "No") { echo ("YES
No"); } else { echo ("YES
No"); } ?>
Comments:

Please click only once.
$temp) { $_POST[$tempRowNumber] = str_replace(""", "\"", $_POST[$tempRowNumber]); } /* Set variables equal to their "posted" values". We need to do this because "register_globals = off" is the default. */ $contactFirstName = $_POST['contactFirstName']; $contactLastName = $_POST['contactLastName']; $contactCharacterBugs = $_POST['contactCharacterBugs']; $contactDaffy = $_POST['contactDaffy']; $contactRoadRunner = $_POST['contactRoadRunner']; $contactCoyote = $_POST['contactCoyote']; $contactEmail = $_POST['contactEmail']; $contactAgeGroup = $_POST['contactAgeGroup']; $contactAddMailingList = $_POST['contactAddMailingList']; $contactComments = $_POST['contactComments']; /* If the user skipped required fields or entered invalid values, write an appropriate error message. */ if ($contactFirstName == "") exit("

Your First Name is missing.

"); if ($contactLastName == "") { exit("

Your Last Name is missing.

"); } if (!(eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$",$contactEmail))): exit("

Email Address appears to be invalid.

"); endif; $emailDomain = ltrim(strstr($contactEmail, '@'), '@'); if(!(checkdnsrr($emailDomain, ANY))) exit("

Email Address Domain can not be found on the internet.

"); /* Construct list of favorite characters */ $favoriteCharactersList = ""; if ($contactCharacterBugs == "YES") $favoriteCharactersList .= "Bugs Bunny, "; if($contactDaffy == "YES") $favoriteCharactersList .= "Daffy Duck, "; if($contactRoadRunner == "YES") $favoriteCharactersList .= "Road Runner, "; if($contactCoyote == "YES") $favoriteCharactersList .= "Wiley Coyote"; /* Construct the email messages */ $messageToAcme = "Please send me more information about Acme products"; $messageToAcme .= "\n\n First Name = " . $contactFirstName; $messageToAcme .= "\n Last Name = " . $contactLastName; $messageToAcme .= "\n Email = " . $contactEmail; $messageToAcme .= "\n\n My interests are:"; $messageToAcme .= "\n Favorite Characters = " . $favoriteCharactersList; $messageToAcme .= "\n Age Group = " . $contactAgeGroup; $messageToAcme .= "\n Add me to mailing list = " . $contactAddMailingList; $messageToAcme .= "\n\n Comments = " . $contactComments; $fullAcmeName = $contactFirstName ." " .$contactLastName; $mailAcmeHeaders = "From: \"".$fullAcmeName."\"<".$contactEmail.">\n"; $mailAcmeHeaders .= "Reply-to: ".$contactEmail; $messageToRequestor = "Thanks, " .$contactFirstName .", for requesting information about Acme products"; $messageToRequestor .= "\n Your email will totally ignored just like 38% of the F500 ignore emails."; $mailRequestorHeaders = "From: \"Dave Barnes\"\n"; $mailRequestorHeaders .= "Reply-to: " ."dave@marketingtactics.com"; /* You need to change dave@marketingtactics.com to YOUR email address */ if (mail("dave@marketingtactics.com", "Please Send Acme Info", $messageToAcme, $mailAcmeHeaders)) { mail ($contactEmail, "Acme Request Received", $messageToRequestor, $mailRequestorHeaders); header("Location: ../../ThankYous/Thanks_Request_Info_Success.html"); /* Redirect browser */ exit; /* Make sure that code below does not get executed when we redirect. */ } else { header("Location: ../../ThankYous/Thanks_Request_Info_Failure.html"); mail("webmaster@marketingtactics.com", "Acme, Request Info Failure", $messageToAcme, $mailAcmeHeaders); exit; } } ?>