It looks like this is a two part process...?
I am trying to follow the threads and place all code to get this to work in one place. currently this is not working.
(this code is not mine, and was coppied from others on this site) thank you
Email Form 1:2
mailer.php should be uploaded to the same location as index.htm
1) Copy and paste code below to a notepad file called mailer.txt and rename to mailer.php
Text highlighted in red may be edited to suit
Code:
<?PHP
$to = "youremail@wherever.com";
$subject = "Contact Form response";
$headers = "From: Form Mailer";
$forward = 0;”Changing this flag from 0 to 1”
$location = "";”change this to “Thankyou.htm” a thanks for e-mailing page”
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is a message from your contact form submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for contacting us. We will get back to you as soon as possible.";
}
?>
Email Form 2:2
2) Place this in a placeholder:
Code:
<font face=verdana size=1>
Contact Us:<br>
<form action="mailer.php" method="post">
Your Name: <input type="text" name="test"><br>
Your Email: <input type="text" name="email"><br><br>
Your Message:<br> <textarea name="message" rows="8" cols="35"></textarea><br>
<input type="submit" name="submit" value="Submit">
</form>
</font>
Bookmarks