session_start();
// Has the form been submitted? If not skip to the HTML
if( isset($_POST['submit'])) {
// Check if the security code matched the image.
if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {
//If the security code was entered correctly process the form
$mailto = "staff@mountainbikingchiangmai.com";
$subject = $_POST['subject'];
$redirect = $_POST['redirect'];
$email = $_POST['email'];
$msg = $_POST['message'];
$name = $_POST['fullname'];
$message = "Name : ".$name;
$message .= "
Email : ".$email;
$message .= "
Message : ".$msg;
if (@mail($mailto, $subject, $message, "From:staff@mountainbikingchiangmai.com\r\nContent-type: text/html; charset=UTF-8")) {
header("Location: $redirect");
unset($_SESSION['security_code']);
} else {
// This echo's the error message if the email did not send.
// You could change the text in between the
tags. echo('
Mail could not be sent. Please use your back button to try again.
'); } } } ?>![]() |
![]() |
![]() |
![]() ![]() |
![]() ![]() ![]() ![]() |
![]() ![]() ![]()
|
![]() | | |
![]() |