View Single Post
  #18  
Old 21st June 2018, 00:44
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
so Has it been confirmed what I posted did not work? I know Botanicar said that he was not able to test it.
here this one is updated and should work
Code:
<?php 

class TSUE_captcha
{
    private $apiURL = "https://www.google.com/recaptcha/api/siteverify?secret=";
    private $privatekey = "6LfHFTQUAAAARFGHTDGGOyBEj7S";
    public $status = false;
    public $error = "";

    public function verifyCaptcha($recaptcha_challenge_field = "", $recaptcha_response_field = "")
    {
        global $_SERVER, $_POST;
                $ip = $_SERVER['REMOTE_ADDR'];
                $response=file_get_contents($this->apiURL.$this->privatekey."&response=".$_POST["g-recaptcha-response"]."&remoteip=".$ip);
                $responseKeys = json_decode($response,true);         
                $this->status = intval($responseKeys["success"]) !== 1 ? false : true;
                if(!$this->status)
                {
                    $this->error = $responseKeys['error-codes'][0];
                }

        return $this->status;
    }

}
?>
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/

Last edited by joeroberts; 21st June 2018 at 00:56.
Reply With Quote