Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1.  <?php
  2.   require_once('recaptchalib.php');
  3.   $privatekey = "6Lebz8ESAAAAABRHLuMQHbGvRDrxn_MSB1qTMZ0T";
  4.   $resp = recaptcha_check_answer ($privatekey,
  5.                                 $_SERVER["REMOTE_ADDR"],
  6.                                 $_POST["recaptcha_challenge_field"],
  7.                                 $_POST["recaptcha_response_field"]);
  8.  
  9.   if (!$resp->is_valid) {
  10.     // What happens when the CAPTCHA was entered incorrectly
  11.     die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
  12.          "(reCAPTCHA said: " . $resp->error . ")");
  13.   } else {
  14.     // Your code here to handle a successful verification
  15.   }
  16.   ?>
  17.  
  18. <?php
  19. $name = $_REQUEST['name'];
  20. $email = $_REQUEST['email'];
  21. $comment = $_REQUEST['comment'];
  22.  
  23. if(mail( "admin@adamwilson.co.cc", "Contact Form", $comment, "From: $email" )){
  24.    echo ("<p>Message sent to <span>".$email."</span></p>");
  25. } else {
  26.    echo("<p>Message not sent to <span>".$email."</span></p>");
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement