This subject has probably been flogged to death, but as a PHP newbie its giving me a bit of grief.
Its a simple form redirect on submission. Ive used a piece of code ive found and have altered is slightly for my own use.
Ive read many artices on the subject and think im in the right area, but cant seem to get the syntax right within the code. Im using the:
header("Location:http://www.xxxxxxx.com/index.php"
command. Below is my code so far.
<?php
if ($submit) {
if ($customerName <= "")
$message = "Please enter your name.";
else if ($customerEmail <= "")
$message = "Please enter your email address.";
else if ($customerMessage <= "")
$message = "Please insert your message.";
if ($message)
echo ($message);
else {
mail("webmaster@turkeybrain.co.uk",
"Form Results",
"$customerName submitted the following message
Subject: $subject
Operating System: $operatingsystem
Browser: $browser
Message: $customerMessage",
"From: $customerName <$customerEmail>");
echo ("Thank you for submitting your message. A representative will contact you shortly if necessary.");
die();
}
}
?>
Any direction where to add the script would be helpful. I have experimeted but get the 'headers already sent' error message