Guest User

Untitled

a guest
Jul 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. if (isset($_POST['recaptcha_response_field']) && isset($_POST['recaptcha_challenge_field'])){
  4. // process captcha
  5. $recaptcha_challenge_field = $_POST['recaptcha_challenge_field'];
  6. $recaptcha_response_field = $_POST['recaptcha_response_field'];
  7. $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $recaptcha_challenge_field, $recaptcha_response_field);
  8.  
  9. if (!$resp->is_valid){
  10. die ("The reCAPTCHA wasn't entered correctly. Go back and try it again.<!-- reCAPTCHA said: " . $resp->error . ") -->");
  11. }else{
  12. $formdata = (isset($_POST['formdata'])) ? explode("&",urldecode($_POST['formdata'])) : array();
  13. // create associative array for form fields and values
  14. $formfields = array();
  15. foreach ($formdata as $key => $val){
  16. $arr = explode("=",$val);
  17. $formfields[$arr[0]] = $arr[1];
  18. unset($arr);
  19. }
Add Comment
Please, Sign In to add comment