setCookieFile() public method

Set Cookie File
public setCookieFile ( $cookie_file )
$cookie_file
Exemplo n.º 1
0
 /**
  * @author mohuishou<*****@*****.**>
  * @return array
  */
 public function loginJwc()
 {
     $this->_curl->setOpt(CURLOPT_FOLLOWLOCATION, true);
     $this->_curl->setOpt(CURLOPT_ENCODING, 'gzip');
     $this->_curl->setCookieFile(__DIR__ . '/../cookie/college-' . $this->_uid . '.cookie');
     $this->_curl->get($this->_url_login_jwc);
     if ($this->_curl->error) {
         echo 'Error: ' . $this->_curl->errorCode . ': ' . $this->_curl->errorMessage;
     } else {
         $this->_jwc_cookie = $this->_curl->getResponseCookies();
         return $this->_jwc_cookie;
     }
 }
Exemplo n.º 2
0
<?php

require __DIR__ . "/../vendor/autoload.php";
use Curl\Curl;
$curl = new Curl();
/*$url='http://new.yangyue.com.cn/renhao_gv1_sjz/yzm.php';
$cookie_jar = dirname(__FILE__)."/pic.cookie";
echo $cookie_jar;
$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);
print_r($curl->rawResponseHeaders);
echo '<br />';
print_r($curl->rawRequestHeaders);
echo '<br />';
echo $g;*/
$names = $_COOKIE[session_name()];
$host = $_SERVER['HTTP_HOST'];
$cookie_jar = dirname(__FILE__) . "/" . $host . '/' . $names;
$url = 'http://new.yangyue.com.cn/renhao_gv1_sjz/phphandle/vote.php';
$i = isset($_GET['i']) ? (int) $_GET['i'] : 53;
$tel = isset($_GET['tel']) ? (int) $_GET['tel'] : 1;
$yzm = isset($_GET['yzm']) ? (int) $_GET['yzm'] : '';
$data = array('i' => $i, 'tel' => $tel, 'yzm' => $yzm);
$curl->setReferer("http://new.yangyue.com.cn/renhao_gv1_sjz/index.php?from=timeline&isappinstalled=0");
$curl->setCookieFile($cookie_jar);
$getData = $curl->post($url, $data);
echo $getData;
Exemplo n.º 3
0
    print $arrestee;
    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);