APC
09-14-2008, 11:17 AM
Hey all, I'm having a little bit of a problem trying to spot the error in the following piece of code:
<?php
if(isset($_POST['name'])) {
$name = $_POST['name'] . "\n";
$email = $_POST['email'] . "\n";
$subject = $_POST['subject'] . "\n";
$messageorig = $_POST['message'] . "\n";
$message = "Name: $name " . "\n";
$message .= "Email: $email " . "\n";
$message .= "Message: $messageorig " . "\n";
if(mail("emailaddress@hotmail.com", $subject, $message, "From: Contact Form")) {
header("Location: thankyou.html");
} else {
echo "Mail sending failed";
}
}
?>
The page thankyou.html exists and works fine. I've been using this page for about 4 or 5 months now and it's been working fine, however when I tested it yesterday the email sent succcesfully, however the page didn't redirect to thankoyu.html Can anybody please spot why?
TIA
Ant
<?php
if(isset($_POST['name'])) {
$name = $_POST['name'] . "\n";
$email = $_POST['email'] . "\n";
$subject = $_POST['subject'] . "\n";
$messageorig = $_POST['message'] . "\n";
$message = "Name: $name " . "\n";
$message .= "Email: $email " . "\n";
$message .= "Message: $messageorig " . "\n";
if(mail("emailaddress@hotmail.com", $subject, $message, "From: Contact Form")) {
header("Location: thankyou.html");
} else {
echo "Mail sending failed";
}
}
?>
The page thankyou.html exists and works fine. I've been using this page for about 4 or 5 months now and it's been working fine, however when I tested it yesterday the email sent succcesfully, however the page didn't redirect to thankoyu.html Can anybody please spot why?
TIA
Ant