相关疑难解决方法(0)

CURL如何使用Captcha和Session登录

define('COOKIE', './cookie.txt');
define('MYURL', 'https://register.pandi.or.id/main');

function getUrl($url, $method='', $vars='', $open=false) {
    $agents = 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16';
    $header_array = array(
        "Via: 1.1 register.pandi.or.id",
        "Keep-Alive: timeout=15,max=100",
    );
    static $cookie = false;
    if (!$cookie) {
        $cookie = session_name() . '=' . time();
    }
    $referer = 'https://register.pandi.or.id/main';
    $ch = curl_init();
    if ($method == 'post') {
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, "$vars");
    }
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header_array);
    curl_setopt($ch, CURLOPT_USERAGENT, $agents);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, …

php cookies captcha curl

13
推荐指数
1
解决办法
2万
查看次数

标签 统计

captcha ×1

cookies ×1

curl ×1

php ×1