In the document with the form, you must have this:
Code:
<form method="post" action="form2mail.php">
Then, upload the following file to the same directory as form2mail.php after editing everything:
Code:
<?php
// Script by George A. & Calin S. from Web4Future.com. Modified slightly by haxor41789 for standards compliance.
// EDIT THE FOLLOWING VARIABLES
$MailToAddress = "[email protected]"; // This is your email address. Use ", " to seperate multiple addresses.
$redirectURL = "http://www.web4future.com/thankyou.htm"; // The URL of the thank you page.
$MailSubject = "[Message from the contact form]"; // The subject of the message you will receive
$MailToCC = ""; // Also sends the email to this address (leave empty if you don't use it)
// DO NOT EDIT BELOW THIS LINE
$Message = "";
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$Message .= "<strong>$key:</strong> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$Message .= "$vala, ";
}
$Message .= "<br />";
}
else {
$val = stripslashes($val);
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $Message .= "$key: - <br>"; }
else { $Message .= "<strong>$key:</strong> $val<br>"; }
}
}
}
$Message = "<span style=\"font-face:verdana;font-size:12px;\">".$Message."</span>";
mail( $MailToAddress, $MailSubject, $Message, "Content-Type: text/html; charset=ISO-8859-1\r\nFrom: ".$email."\r\nBCc: ".$MailToCC);
header("Location: ".$redirectURL);
?>
Set permissions to --rwxr-xr-x and you're good to go.
Hope this helps.
Bookmarks