Jump to content
GIGN Forum

Recaptcha


blindmind
 Share

Recommended Posts

Es maz ko saprotu no php, tikai kko uzinstalet, nedaudz pielabot utt.

Tatad man vajag lai Recaptcha redirekto uz lapa2.php, ja captcha ir ievadita pareiza. Meginaju ar header location, raksta ka header already sent..

Sheit bus kods:

<?php

require_once('recaptchalib.php');
$publickey = "garsh penteris ar cipariem un burtiem";
$privatekey = "garsh penteris ar cipariem un burtiem";

# the response from reCAPTCHA
$resp = null;

# the error code from reCAPTCHA, if any
$error = null;



# was there a reCAPTCHA response?
if ($_POST["recaptcha_response_field"]) {
       
     $resp = recaptcha_check_answer ($privatekey,
                                       
                 $_SERVER["REMOTE_ADDR"],
                                      
                  $_POST["recaptcha_challenge_field"],
                                        
                $_POST["recaptcha_response_field"]);

       
         if ($resp->is_valid) {
                
            echo "yay, tu ievadiji pareizi";
       
         } else {
                
            # set the error code so that we can display it
               
                 $error = $resp->error;
       
                         }
                    
}
echo recaptcha_get_html($publickey, $error);
            
?>

Link to comment
Share on other sites

  • 2 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...