Download the PHP package mangdin/thinkphp5.1-geetest without Composer
On this page you can find all versions of the php package mangdin/thinkphp5.1-geetest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mangdin/thinkphp5.1-geetest
More information about mangdin/thinkphp5.1-geetest
Files in mangdin/thinkphp5.1-geetest
Download mangdin/thinkphp5.1-geetest
More information about mangdin/thinkphp5.1-geetest
Files in mangdin/thinkphp5.1-geetest
Vendor mangdin
Package thinkphp5.1-geetest
Short Description thinkphp5.1 geetest验证码
License Apache-2.0
Package thinkphp5.1-geetest
Short Description thinkphp5.1 geetest验证码
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package thinkphp5.1-geetest
thinkphp5.1-geetest
thinkphp5.1 geetest验证码
服务端验证代码
$config = Config::get('geetest.');
$GtSdk = new \mangdin\geetest\GeetestLib($config['geetest_id'], $config['geetest_key']);
$data = array(
"client_type" => "web", #web:电脑上的浏览器;h5:手机上的浏览器,包括移动应用内完全内置的web_view;native:通过原生SDK植入APP应用的方式
"ip_address" => \think\facade\Request::host(), # 请在此处传输用户请求验证时所携带的IP
);
if (Session::get('gtserver') == 1) { //服务器正常
$code = $GtSdk->success_validate($_POST['geetest_challenge'], $_POST['geetest_validate'], $_POST['geetest_seccode'],$data);
}else{ //服务器宕机,走failback模式
$code = $GtSdk->success_validate($_POST['geetest_challenge'], $_POST['geetest_validate'], $_POST['geetest_seccode']);
}
if (!$code){
$this->error('验证码错误');
}
unset($data);
unset($code);
unset($config);
服务端验证码生成代码
public function geetest(){
$config = Config::get('geetest.');
$GtSdk = new \mangdin\geetest\GeetestLib($config['geetest_id'], $config['geetest_key']);
$data = array(
"client_type" => "web", #web:电脑上的浏览器;h5:手机上的浏览器,包括移动应用内完全内置的web_view;native:通过原生SDK植入APP应用的方式
"ip_address" => \think\facade\Request::host(), # 请在此处传输用户请求验证时所携带的IP
);
$status = $GtSdk->pre_process($data, 1);
\think\facade\Session::set('gtserver',$status);
echo $GtSdk->get_response_str();
}
前台页面代码
All versions of thinkphp5.1-geetest with dependencies
PHP Build Version
Package Version
No informations.
The package mangdin/thinkphp5.1-geetest contains the following files
Loading the files please wait ...