I have made a rather simple form for my website consisting of two text boxes and a drop down list containing two choices. I have set up a .php file to have an email sent to me with the entered data. I am able to receive the email with the data for the two text boxes, but I can’t figure out the script to display the list choice. I am very very new to all of this, so I hope I have described my problem effectively.
Here is the form, and below the .php script I am having problem with.
[code]
URL: | |
Email address: | |
Exchange Type: | Basic Premium |
|
$headersep = (!isset( $uself ) || ($uself == 0)) ? “rn” : “n” ;
$name = $_POST[‘name’] ;
$email = $_POST[‘email’] ;
$comments = $_POST[‘select’] ;
$http_referrer = getenv( “HTTP_REFERER” );
if (!isset($_POST[‘email’])) {
header( “Location: $formurl” );
exit ;
}
if (empty($name) || empty($email)) {
header( “Location: $errorurl” );
exit ;
}
if ( ereg( “[rn]”, $name ) || ereg( “[rn]”, $email ) ) {
header( “Location: $errorurl” );
exit ;
}
$messageproper =
"This message was sent from:n" .
"$http_referrern" .
"------------------------------------------------------------n" .
"Name of sender: $namen" .
"Email of sender: $emailn" .
"Type: $selectn" .
"nn------------------------------------------------------------n" ;
mail($mailto, $subject, $messageproper,
“From: “$name” <$email>” . $headersep . “Reply-To: “$name” <$email>” . $headersep . “X-Mailer: chlinkus.php 2.08” );
header( “Location: $thankyouurl” );
exit ;
[/code]
Admin Edit: Added Missing end CODE tag