This is my first post and I am a PHP Noob so go easy if the answer to this article is in the depths of the database somewhere.
Basically I have an email form that is processed via a php file. When the user successfully submits their details I want them to be re-directed to a URL.
Currently the script I am using only re-directs to "URL=ok.htm\" but I want to re-direct with an absolute path URL because the actual site is on another server and not in that relative directory.
Here's the code:
Code: Select all
<?php
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "xxxxxxxxx@xxxx.xxx";
$Subject = "hi";
$hello = Trim(stripslashes($_POST['hello']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "hello: ";
$Body .= $hello;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
I know this is probably a simple syntax error or I am missing something, but I can't work it out!
Cheers
Hank