自动打码识别验证码服务端带demo

2021-03-02 10:39:10 浏览数 (6)

易语言通用验证码识别服务端,用来做接口还是可以的!

将127.0.0.1改成自己的服务器IP,或者域名

php:

代码语言:javascript复制
$rel = file_get_contents('http://www.zhuangjiba.com/d/file/help/2018/08/cfdefaddb3f47d78f8c66a7de28720aa.png');
$code = _upload($rel);
echo '验证码:'.$code;
function _upload($post=0){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:5658');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

    //curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
    if ($post) {
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    }
    //curl_setopt($ch, CURLOPT_REFERER, 'http://kfupload.alibaba.com');
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36');
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    $data = curl_exec($ch);
    curl_close($ch);
    if ($data){
        return $data;       
    }else{
        return false;
    }
}

此处内容需要评论回复后(审核通过)方可阅读。


版权属于:尹深

本文链接:https://cloud.tencent.com/developer/article/1795081

转载时须注明出处及本声明

(本站部分资源来自互联网收集整理!如有侵权请联系站长删除!!!)

0 人点赞