Emailing the results of form entry NOT working
| From: | Denis Croombs | Date: | Thu, 02 Aug 2001 11:49:57 +0000 |
| Subject: | Emailing the results of form entry NOT working | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-60885@lists.php.net to get a copy of this message | ||
I am using the form below, and it works except for sending the message to
the user, any ideas/clues ?
Being so close to it working is driving me nuts !
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Feedback Form</title>
</head>
<body>
<form action="simplefeedback.php" method="post">
<p>Please provide me your feedback!</p>
<p>Enter your name: <input type="text" name="name"
size="40"></p>
<p>Enter you e-mail: <input type="text" name="email"
size="40"></p>
<p>Enter your feedback:<br>
<textarea name="feedback" rows="3"
cols="50"></textarea></p>
<p><input type="submit" name="submit" value="Send
Feedback">
</form>
</body>
</html>
<?
if(!$submit) {
header("Location: http://www.imsltd.com/feedback.html");
}
$to = "support@imsltd.com";
$subject = "Feedback";
$mail_body = "Feedback From Your Site\n";
$mail_body .= "Sender's Name: $name\n";
$mail_body .= "Sender's E-Mail: $email\n";
$mail_body .= "Feedback: $feedback\n\n";
$mail_headers = "From: My Web Site <> \n";
$mail_headers .= "Reply-To: $sender_email\n\n";
mail($mail_to, $mail_subject, $mail_body, $mail_headers);
?>
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Feedback Form</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff"
vlink="#800080"
alink="#ff0000">
<p><b>Thank you for your feedback.<br>You have sent the following
feedback:</b></p>
<p>Your Feedback Message:<br>
<? echo "$feedback"; ?></p>
<p>Your Name: <? echo "$name"; ?></p>
<p>Your Email: <? echo "$email"; ?></p>
</body>
</html>
Many thanks
Denis Croombs