承接 devstrefa/recaptcha 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devstrefa/recaptcha

Composer 安装命令:

composer require devstrefa/recaptcha

包简介

PHP Library to verify google reCaptcha challenge

README 文档

README

Build Status

Simple PHP Library, designed for verifications of Google reCaptcha.

Why ?

Simple answer for this question is "I really don't know" :) but seriously, it is very simple project ideal for learning several PHP-Development tools, and if this library could be usefull for someone else that's great.

How to install

Library is compatible with composer so You can install it by adding:

"require": {
        "devstrefa/recaptcha": "1.0.x-dev"
    }

to Your composer.json file

You can also download zip file and include all necessery files by yourself

How to use package

After installing / downloading package you can use it in very simple way. First of all if you are not using Composer autoloader (or any PSR-4 compatible loader) You should be sure that You include all necessery files, after that it's very simple.

Before you start integrate reCaptcha on your site visit reCaptcha Page and generate pair of keys, You can do this by clicking get reCaptch button.

Next add to your html file in <head> section:

<script src='https://www.google.com/recaptcha/api.js'></script>

after that insert this code in place where you want to display your captcha widget (it must be inside <form></form> tags)

<div class="g-recaptcha" data-sitekey="place_your_public_key_here"></div>

Now when you refresh page you should see reCaptcha widget, if it's working You can go now to PHP part

Whole code is really simple:

<?php

use \DevStrefa\ReCaptcha\ReCaptcha;
use \DevStrefa\ReCaptcha\Senders\FgcSender;

$reCaptcha = new ReCaptcha('secret_key_here', new FgcSender());
$reCaptcha->setResponse($_POST['g-recaptcha-response']);
$response=$reCaptcha->verify();

if ($response->isSuccess())
{
	echo 'OK';
}
else
{ 
	echo 'Error';
}   

That's it! For more informations about library please check included example, and read genereated documentation.

ToDo

  • More Senders (Curl etc.)

Changelog

You can see Changelog for this project here

License

Whole code in this repository is Under MIT license

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固