Do I put the
$_SESSION["post"]=$_POST;
in the "welcome.php" ? At the moment it looks like this...
<?PHP
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = 'NAME: ' . $name . "\n\n";
$message .= 'EMAIL: ' . $email . "\n\n";
$message .= 'PROPERTY: ' . $subject . "\n\n";
$message .= 'MESSAGE: ' . $_POST['message'];
$target_address = 'my-email-address';
$headers = "From: ".$email."\r\n". "X-Mailer: php";
if (mail($target_address, $subject, $message, $headers)) {
echo ("Your message has been sent, the owner will contact you as soon as possible. Please hit the Back button to return to the property page.");
}
else{
echo ("Sorry your message delivery failed. Please hit the back button, make sure all fields are complete and try again");
die();
}
?>
Also, is it possible to use the "echo" the variables to return the relevant info on the same page...
i.e. something like
echo (Thank you 'name', your message... 'message' has been sent. You will be contacted shortly)