setCookieJar() public method

Set Cookie Jar
public setCookieJar ( $cookie_jar )
$cookie_jar
Exemplo n.º 1
0
 /**
  * @author mohuishou<*****@*****.**>
  * @param $key
  * @return array
  */
 public function loginCollege($key)
 {
     $this->_curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
     $this->_curl->setCookieJar(__DIR__ . '/../cookie/college-' . $this->_uid . '.cookie');
     $this->_curl->get($this->_url_login_college, array('CTgtId' => $key));
     if ($this->_curl->error) {
         echo 'Error: ' . $this->_curl->errorCode . ': ' . $this->_curl->errorMessage;
     } else {
         $this->_college_cookie = $this->_curl->getResponseCookies();
         return $this->_college_cookie;
     }
 }
Exemplo n.º 2
0
<?php

/**
 * Created by PhpStorm.
 * User: lee
 * Date: 15-12-25
 * Time: 下午2:01
 */
header('Content-Type:image/png');
require __DIR__ . "/../vendor/autoload.php";
use Curl\Curl;
$curl = new Curl();
$url = 'http://new.yangyue.com.cn/renhao_gv1_sjz/yzm.php';
$names = $_COOKIE[session_name()];
$host = $_SERVER['HTTP_HOST'];
if (is_dir($host)) {
} else {
    $res = mkdir(iconv("UTF-8", "GBK", $host), 0777, true);
}
$cookie_jar = dirname(__FILE__) . "/" . $host . '/' . $names;
$curl->setCookieJar($cookie_jar);
$curl->setUserAgent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/47.0.2526.73 Chrome/47.0.2526.73 Safari/537.36");
$g = $curl->get($url);
echo $g;
Exemplo n.º 3
0
    exit;
} else {
    if ($_REQUEST['action'] == 'import') {
        $data = $_REQUEST;
        unset($data['action']);
        $id = $data['id'];
        unset($data['id']);
        updateArrestee($data, $id);
        print "ok";
        exit;
    }
}
if (isset($_REQUEST['frame'])) {
    $curl = new Curl();
    $curl->setCookieFile('cookies');
    $curl->setCookieJar('cookies');
    $_REQUEST['courtCode'] = $_REQUEST['courtCode'] ? $_REQUEST['courtCode'] : '01440';
    if (!isset($_REQUEST['viewDetails']) && !isset($_REQUEST['returnToSearchResult'])) {
        if ($_REQUEST['reportNumber']) {
            $_REQUEST['courtCode'] = '';
        }
        $_REQUEST['findDocket'] = 'x';
        $curl->post("http://www.acgov.org/sheriff_app/docket/docketSearch.do", $_REQUEST);
    } else {
        $curl->get("http://www.acgov.org/sheriff_app/docket/docketDetail.do", $_REQUEST);
    }
    $html = $curl->response;
    $curl->get('http://www.acgov.org/sheriff_app/jcaptcha.do');
    file_put_contents('image.jpg', $curl->response);
    $html = preg_replace("/\"\\/sheriff/", '"http://www.acgov.org/sheriff', $html);
    $html = preg_replace("/action=\".*?\"/", 'action="docketFinder.php"', $html);