Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- $to = "YOUR EMAIL";
- $subject = "Contact Page";
- $headers = "From: Contact Page";
- $forward = 0;
- $location = "";
- $date = date ("l, F jS, Y");
- $time = date ("h:i A");
- $msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
- $email;$comment;$captcha;
- if(isset($_POST['email'])){
- $email=$_POST['email'];
- }if(isset($_POST['comment'])){
- $email=$_POST['comment'];
- }if(isset($_POST['g-recaptcha-response'])){
- $captcha=$_POST['g-recaptcha-response'];
- }
- if(!$captcha){
- echo '<h2>Please check the the captcha form.</h2>';
- exit;
- }
- if ($_SERVER['REQUEST_METHOD'] == "POST") {
- foreach ($_POST as $key => $value) {
- $msg .= ucfirst ($key) ." : ". $value . "\n";
- }
- }
- else {
- foreach ($_GET as $key => $value) {
- $msg .= ucfirst ($key) ." : ". $value . "\n";
- }
- }
- mail($to, $subject, $msg, $headers);
- if ($forward == 1) {
- header ("Location:$location");
- }
- else {
- include("index.html");
- }
- $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=KEYFROM GOOGLE&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']);
- if($response.success==false)
- {
- echo '<h2>You are spammer ! Get the @$%K out</h2>';
- }else
- {
- echo '<h2>Thanks for posting comment.</h2>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement