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

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

php:

$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;
    }
}

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

Last modification:February 2nd, 2020 at 07:57 pm
如果觉得我的文章对你有用,请随意赞赏