Hi
This is what im using in most of my sites:
PHP Code:
<?
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;
$mailto = 'admin@YourDomain.com;
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;
$subject = "Contact Form" ;
// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://www.YourDomain.com/offer.html" ;
$errorurl = "http://www.YourDomain.com/error.html" ;
$thankyouurl = "http://www.YourDomain.com/thank.html" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$domain = $_POST['domain'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($domain) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"NAME:\n" .
"$name\n\n" .
"EMAIL:\n" .
"$email\n\n" .
"DOMAIN:\n" .
"$domain\n\n" .
"COMMENTS\n" .
"$comments\n" .
"\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.02" );
header( "Location: $thankyouurl" );
exit ;
?>
*Copy the code and save it as feedback.php
*You will need a thank you page & error page.
*You will also need to place this in your contact page:
<form action="http://www.YourDomain.com/feedback.php" method="post">
It always work for me.
