First off, hi to everyone and thank you for checking this out.
I am trying to have this open a url (in the same directory) instead of to this:
$thankyou_message = "<p>Thankyou. Your message has been sent and I will contact you as soon as possible.</p>"; I would rather have this point somewhere back to my site as you can see it currently navigates people away without a way for them to get back.
Thanks!
<?php
// Change to your own email address
$your_email = "test@gmail.com";
// This is what is displayed in the email subject line
// Change it if you want
$subject = "";
// This is displayed if all the fields are not filled in
$empty_fields_message = "<p style='color:#a00'>Please fill in all fields.</strong></p>\n";
// This is displayed when the email has been sent
$thankyou_message = "<p>Thankyou. Your message has been sent and I will contact you as soon as possible.</p>";
// You do not need to edit below this line
$name = stripslashes($_POST['txtName']);
$email = stripslashes($_POST['txtEmail']);
$message = stripslashes($_POST['txtMessage']);
if (!isset($_POST['txtName'])) {
}
elseif (empty($name) || empty($email) || empty($message)) {
echo $empty_fields_message;
}
else {
/*
// Stop the form being used from an external URL
// Get the referring URL
$referer = $_SERVER['HTTP_REFERER'];
// Get the URL of this page
$this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
// If the referring URL and the URL of this page don't match then
// display a message and don't send the email.
if ($referer != $this_url) {
echo "You do not have permission to use this script from another URL.";
exit;
}
*/
// The URLs matched so send the email
mail($your_email, $subject, $message, "From: $name <$email>");
// Display the thankyou message
echo $thankyou_message;
echo $empty_fields_message;
}
?>
Thanks again!
Cheers,
Williwaw