php
// FORM TO EMAIL Dec 27th 2005
// http://www.webformdesigner.com
// The following variables can be changed to suit
// NOTE: In order for the resulting mail message to you to contain the
// relevant information, your form should ideally contain, amongst others,
// two fields called "name" and "email" respectively (note lower case)
// for capturing the user's name & email address
// Change this to the email address where the message is to be sent
$your_email = "youremailaddress@yourserver.com";
// This is the return URL after the form has been processed
$thankyou = "thankyou_page.html";
// This is what is displayed in the email subject line
// Change it if you want
$subject = "Your Form";
// You shouldn't need to edit below this line
// ---------------------------------------------
$name = trim(stripslashes($_POST['name']));
$email = trim(stripslashes($_POST['email']));
$year = date("Y");
$month = date("m");
$day = date("d");
$hour = date("h");
$min = date("i");
$tod = date("a");
// Timestamp this message
$TimeOfMessage = date('d')."/".date('m')."/".date('y')."(".date('D').") @ ".date('H:i');
// finally, send e-mail
$ip=$_SERVER["REMOTE_ADDR"];
$message = "The following was sent on " .$TimeOfMessage."\n";
$message .= "---------------------------------------------------------\n";
// send the complete set of variables as well
while (@list($var,$val) = @each($_POST)) {
if (is_array($val)){
$temp = '';
foreach($val as $newval){
$temp .= "$newval ";
}
$message .= "$var: $temp\n";
} else {
$message .= "$var: $val\n";
}
}
// send the email
mail($your_email, $subject, $message, "From: $name <$email>");
// go to return URL
if (isset($thankyou)) {
header("Location: $thankyou");
exit();
}
?>
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar