CAPTCHA is the abbreviation of "Completely Automated Public Turing test to tell Computers and Humans Apart", It is a public, fully automatic program that distinguishes whether the user is a computer or a human.
载入中 ...
appCdn = "https://cdn.kgcaptcha.com"; // 前端验证成功后颁发的 token,有效期为两分钟 $request->token = $_POST["kgCaptchaToken"]; // 当安全策略中的防控等级为3时必须填写 $request->userId = "kgCaptchaDemo"; // 请求超时时间,秒 $request->connectTimeout = 10; $requestResult = $request->sendRequest(); if ($requestResult->code === 0) { // 验签成功逻辑处理 echo "验证通过"; } else { // 验签失败逻辑处理 echo "验证失败,错误代码:{$requestResult->code}, 错误信息:{$requestResult->msg}"; }
SDK open source address:github.com/KgCaptcha, by the way A demonstration:www.kgcaptcha.com/demo/
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of Share a PHP free verification code (with code). For more information, please follow other related articles on the PHP Chinese website!