*/ /* No Space Between PHP and HTML */ /* Contact Error CSS .contacterror { font-family: 'Droid Sans', sans-serif; font-size: 18px; font-weight:normal; line-height:125%; color:#ff0000; } */ $sitekey = "6LflYfsSAAAAAGW7lI99-2LArH8zimNmdPKiQUQW"; $secret = "6LflYfsSAAAAADsdIz7Jl468c9HyDMGZj-_A0Wu7"; $contactform = "florence-oregon-food.html"; /*

*/ $error = ""; $name = ""; $emailaddress = ""; $phonenumber = ""; $note = ""; if ($_SERVER['REQUEST_METHOD']== "POST") { $contactformsent = "florence-oregon-food-sent.html"; $contactformsite = "https://www.bridgewaterfishhouse.com"; $contactformreceiver = "info@bridgewaterfishhouse.com"; $contactformreceivercopy = "alancurtis777@outlook.com"; $emailsubject = 'Bridgewater Fish House - Website Inquiry'; $response = $_POST["g-recaptcha-response"]; $url = 'https://www.google.com/recaptcha/api/siteverify'; $data = array( 'secret' => $secret, 'response' => $_POST["g-recaptcha-response"] ); /* $options Array Version 1 - May Be Required $options = array( 'http' => array ( 'method' => 'POST', 'content' => http_build_query($data) ) ); */ /* $options Array Version 2 - May Be Required $query = http_build_query($data); $options = array( 'http' => array ( 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", "Content-Length: ".strlen($query)."\r\n". "User-Agent:MyAgent/1.0\r\n", 'method' => 'POST', 'content' => $query ) ); */ $query = http_build_query($data); $options = array( 'http' => array ( 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", "Content-Length: ".strlen($query)."\r\n". "User-Agent:MyAgent/1.0\r\n", 'method' => 'POST', 'content' => $query ) ); $context = stream_context_create($options); $verify = file_get_contents($url, false, $context); $captcha_success=json_decode($verify); if ($captcha_success->success==false) { $error = "no-captcha"; } else if ($captcha_success->success==true) { /* Check all form inputs using check_input function */ if (empty($_POST['Name'])) { $error = "no-name"; } if (empty($_POST['EmailAddress'])) { $error = "no-email"; } if (empty($_POST['PhoneNumber'])) { $error = "no-phone"; } if (empty($_POST['Note'])) { $error = "no-note"; } if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $_POST['EmailAddress'])) { $error = "no-valid-email"; } $name = $_POST['Name']; $emailaddress = $_POST['EmailAddress']; $phonenumber = $_POST['PhoneNumber']; $note = $_POST['Note']; if (empty($error)) { /* Set e-mail recipient */ $emailheaders = "MIME-Version: 1.0\n" ; $emailheaders .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; $emailheaders .= "X-Priority: 1 (Highest)\n"; $emailheaders .= "X-MSMail-Priority: High\n"; $emailheaders .= "Importance: High\n"; $emailheaders .= "Cc: " . $contactformreceivercopy; /* Let's prepare the message for the e-mail */ $emailmessage = " This email has been sent to you from: $contactformsite

You have received the following Website Inquiry:

Contact Information

Name: $name
E-mail: $emailaddress
Phone Number: $phonenumber
Message: $note"; /* Send the message using mail() function */ mail($contactformreceiver, $emailsubject, $emailmessage, $emailheaders); /* Redirect visitor to the thank you page */ header("Location: " . $contactformsent); exit(); } } } ?>
Best Florence Oregon Food | Bridgewater Fish House

florence oregon

1297 Bay Street, Florence, OR 97439

Please place a checkmark next to 'I'm not a robot'

"; } if ($error=='no-name') { echo "

Please enter your name.

"; } if ($error=='no-email') { echo "

Please enter your email address.

"; } if ($error=='no-phone') { echo "

Please enter your phone number.

"; } if ($error=='no-note') { echo "

Please enter a message.

"; } if ($error=='no-valid-email') { echo "

Please enter a valid email address.

"; } ?>
Name:
Email Address:
Phone Number:
Message: