GithubHelp home page GithubHelp logo

appleboy / codeigniter-recaptcha Goto Github PK

View Code? Open in Web Editor NEW
107.0 15.0 82.0 14 KB

reCAPTCHA library for CodeIgniter

Home Page: https://www.google.com/recaptcha/intro/index.html

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%

codeigniter-recaptcha's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeigniter-recaptcha's Issues

How to use?

Hello,
how to use your library with form_validation?

Thanks!

Turn reCAPTCHA on/off

Hi
I want to switch recaptcha on/off with settings for a template. is this possible? if yes, how?
thanks in advance

Invisible reCAPTCHA

What about hadling the new invisible reCAPTCHA widget?
I'm interested in submitting forms with jQuery AJAX and assigning the "g-recaptcha" class to the async submit button.
Any help/update appreciated.

Unable to run file_get_contents due to shared hosting restrictions

Due to my restrictions on a shared server, I am unable to run file_get_contents or even set

allow_url_fopen = on

Therefore I had to edit the library file: CodeIgniter-reCAPTCHA/libraries/Recaptcha.php

My changes aren't very clean, but could the concept be used to detect lack of support and use CURL instead?

/**
* Submits an HTTP GET to a reCAPTCHA server.
*
* @param array $data array of parameters to be sent.
*
* @return array response
*/
private function _submitHTTPGet($data)
{
    $url = self::site_verify_url.'?'.http_build_query($data);

    if (!ini_get('allow_url_fopen')) {
        $ch = curl_init();
        $options = array(CURLOPT_URL => $url,
                                   CURLOPT_CONNECTTIMEOUT => 5,
                                   CURLOPT_RETURNTRANSFER => true
        );
        curl_setopt_array($ch, $options);

        $response = curl_exec($ch);
        if (curl_errno($ch)) { 
            $response = '';
        } else {
            curl_close($ch);
        }

        if (!is_string($response) || !strlen($response)) {
            $response = 'Failed to get contents';
       }
   } else {
       $response = file_get_contents($url);
   }

    return $response;
}

Feedback much appreciated.

Missing 'id' for the reCAPTCHA <div>

Please change line #158 in /libraries/Recaptcha.php

from:
return '<div class="g-recaptcha" '.$html.'></div>';

to:
return '<div id="g-recaptcha" class="g-recaptcha" '.$html.'></div>';

to give the DIV an ID so it can be accessible VIA jQuery and/or other frameworks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.