×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Gábor Papp
Added: Jan 23, 2017 2:52 AM
Modified: Jan 23, 2017 3:10 AM
Views: 6
Tags: no tags
  1. $secret = "Secret key innen lekerni https://www.google.com/recaptcha/admin#list";
  2. $verificationResponse = $_POST["g-recaptcha-response"];
  3. if( empty($verificationResponse) ) {
  4.     echo "Valami nem megfelelően lettk kitöltve! <a href=\"javascript:history.go(-1);\">vissza az űrlaphoz</a>"; exit;
  5. }
  6. $response = recaptcha_readURL("https://www.google.com/recaptcha/api/siteverify?secret=".$secret."&response=".$verificationResponse."");
  7. $responseArray = json_decode($response, true);
  8. if( $responseArray["success"] !== true) {
  9.     echo "Valami nem megfelelően lettk kitöltve! <a href=\"javascript:history.go(-1);\">vissza az űrlaphoz</a>"; exit;
  10. }