[php]<?php
if(($_POST['sender_name'] =="") || ($_POST['sender_email'] =="") || ($_POST['message'] =="")){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Simple Feedback Form</title>
</head>
<body>
<form method="post" action="#">
<p><strong>Your Name:</strong><br>
<input name="sender_name" size="30" type="text"></p>
<p><strong>Your E-Mail:</strong><br>
<input name="sender_email" size="30" type="text"></p>
<p><strong>Message:</strong><br>
<textarea name="message" cols="30" rows="5" wrap="virtual"></textarea></p>
<p><input name="submit" value="Send This Form" type="submit"></p>
</form>
</body></html>
<?php
}else { //Something was posted
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .="Sender's name: \t". $_POST['sender_name']. "\n";
$msg .="Sender's E-Mail: \t". $_POST['sender_email']. "\n";
$msg .="Message: \t". $_POST['message']. "\n";
$to ="yourname@yoursite.com";
$subject ="Web Site Feedback";
$mailheaders ="From: Web Site <cccornerstone.org>";
$mailheaders .="\nReply-To: ". $_POST['sender_email']. "\n";
//////////////////////////////////
if ($sentOK = mail($to, $subject, $msg, $mailheaders)) {
// show the below...
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Simple Feedback Form Sent</title>
</head>
<body>
<h1>The following e-mail has been sent:</h1>
<p><strong>Your Name:</strong><br />
<?php echo $_POST['sender_name']; ?>
<p><strong>Your E-Mail Address:</strong><br />
<?php echo $_POST['sender_email']; ?>
<p><strong>Message:</strong><br />
<?php echo $_POST['message']; ?>
</body>
</html>
<?php
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Simple Feedback Form Sent</title>
</head>
<body>
<h1>EMAILl NOT SENT!</h1>
</body>
</html>
<?php
}// END of ELSE NOT SENT
}// END OF ELSE NOT POSTED
?>[/php]
This works on my server. You were putting $_POST's inside of "" marks. That was the problem.
