{"id":13560141,"url":"https://github.com/appleboy/CodeIgniter-reCAPTCHA","last_synced_at":"2025-04-03T15:31:39.074Z","repository":{"id":24312162,"uuid":"27708105","full_name":"appleboy/CodeIgniter-reCAPTCHA","owner":"appleboy","description":"reCAPTCHA library for CodeIgniter","archived":false,"fork":false,"pushed_at":"2019-04-06T22:51:11.000Z","size":14,"stargazers_count":107,"open_issues_count":4,"forks_count":82,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-04-14T09:48:53.215Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.google.com/recaptcha/intro/index.html","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appleboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-08T09:47:36.000Z","updated_at":"2024-01-27T14:32:39.000Z","dependencies_parsed_at":"2022-08-06T02:01:26.437Z","dependency_job_id":null,"html_url":"https://github.com/appleboy/CodeIgniter-reCAPTCHA","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-reCAPTCHA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-reCAPTCHA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-reCAPTCHA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-reCAPTCHA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/CodeIgniter-reCAPTCHA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246646440,"owners_count":20811137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:00:38.236Z","updated_at":"2025-04-03T15:31:34.061Z","avatar_url":"https://github.com/appleboy.png","language":"PHP","readme":"# CodeIgniter-reCAPTCHA\n\nThe FREE anti-abuse service. Easy to add, advanced security, accessible to wide range of users and platforms. This package is compliant with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) and [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).\n\n# What is reCAPTCHA?\n\nreCAPTCHA is a free service that protects your site from spam and abuse. It uses advanced risk analysis engine to tell humans and bots apart. With the new API, a significant number of your valid human users will pass the reCAPTCHA challenge without having to solve a CAPTCHA (See blog for more details). reCAPTCHA comes in the form of a widget that you can easily add to your blog, forum, registration form, etc.\n\nSee [the details][1].\n\n# Sign up for an API key pair\n\nTo use reCAPTCHA, you need to [sign up for an API key pair][4] for your site. The key pair consists of a site key and secret. The site key is used to display the widget on your site. The secret authorizes communication between your application backend and the reCAPTCHA server to verify the user's response. The secret needs to be kept safe for security purposes.\n\n# Installation\n\nYou can install via http://getsparks.org/packages/recaptcha-library/show\n\n```bash\n$ php tools/spark install -v1.0.2 recaptcha-library\n```\n\nor manual install\n\n```bash\n$ cp config/recaptcha.php your_application/config/\n$ cp libraries/recaptcha.php your_application/libraries/\n```\n\n# Usage\n\nSet your site key and secret on `config/recaptcha.php` file\n\n```php\n$config['recaptcha_site_key'] = '';\n$config['recaptcha_secret_key'] = '';\n```\n\n### Render the reCAPTCHA widget\n\n```php\n$this-\u003eload-\u003elibrary('recaptcha');\necho $this-\u003erecaptcha-\u003egetWidget();\n```\n\noutput:\n\n```html\n\u003cdiv class=\"g-recaptcha\" data-sitekey=\"xxxx\" data-theme=\"light\" data-type=\"image\" data-callback=\"\" \u003e\u003c/div\u003e\n```\n\nchange default theme by pass array parameter\n\n```php\necho $this-\u003erecaptcha-\u003egetWidget(array('data-theme' =\u003e 'dark'));\n```\n\nchange default type by pass array parameter\n\n```php\necho $this-\u003erecaptcha-\u003egetWidget(array('data-theme' =\u003e 'dark', 'data-type' =\u003e 'audio'));\n```\n\n### Render Script Tag\n\n```php\n$this-\u003eload-\u003elibrary('recaptcha');\necho $this-\u003erecaptcha-\u003egetScriptTag();\n```\n\noutput:\n\n```html\n\u003cscript type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api.js?render=onload\u0026hl=en\" async defer\u003e\u003c/script\u003e\n```\n\nchange render value by pass array parameter\n\n```php\necho $this-\u003erecaptcha-\u003egetScriptTag(array('render' =\u003e 'explicit'));\n```\n\nchange default language by pass array parameter\n\n```php\necho $this-\u003erecaptcha-\u003egetScriptTag(array('render' =\u003e 'explicit', 'hl' =\u003e 'zh-TW'));\n```\n\n### Verify Response\n\nCalls the reCAPTCHA siteverify API to verify whether the user passes `g-recaptcha-response` POST parameter.\n\n```php\n$recaptcha = $this-\u003einput-\u003epost('g-recaptcha-response');\n$response = $this-\u003erecaptcha-\u003everifyResponse($recaptcha);\n```\n\ncheck success or fail\n\n```php\nif (isset($response['success']) and $response['success'] === true) {\n    echo \"You got it!\";\n}\n```\n\nsee the [example controller](example/controller/test.php) and [view](example/views/recaptcha.php)\n\n# Author\n\nBo-Yi Wu [@appleboy](https://twitter.com/appleboy)\n\n[1]: https://www.google.com/recaptcha/intro/index.html\n[2]: http://www.codeigniter.com/\n[3]: https://developers.google.com/recaptcha/\n[4]: http://www.google.com/recaptcha/admin\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2FCodeIgniter-reCAPTCHA","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2FCodeIgniter-reCAPTCHA","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2FCodeIgniter-reCAPTCHA/lists"}