curl,CURLOPT_COOKIEJAR, $cookieJar); curl_setopt($this->curl,CURLOPT_COOKIEFILE, $cookieJar); //curl_setopt($this->curl,CURLOPT_AUTOREFERER, true); curl_setopt($this->curl,CURLOPT_FOLLOWLOCATION, true); curl_setopt($this->curl,CURLOPT_RETURNTRANSFER, true); //curl_setopt($this->curl, CURLOPT_HTTPPROXYTUNNEL, '193.136.227.163:3124'); curl_setopt($this->curl, CURLOPT_HEADER, 1); //curl_setopt($this->curl, CURLOPT_PROXY, '193.136.227.163:3124'); // curl_setopt($this->curl, CURLOPT_HTTPTUNNELPROXY,'193.136.227.163:3124'); curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, '20'); curl_setopt($this->curl,CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.14'); //SSL ---------------------------------------------------------------------------- curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 2); } function get($url) { $this->curl = curl_init($url); $this->setup(); return $this->request(); } function getAll($reg,$str) { preg_match_all($reg,$str,$matches); return $matches[1]; } function postForm($url, $fields, $referer='') { $timeout = 15; $this->curl = curl_init($url); $this->setup(); curl_setopt($this->curl, CURLOPT_URL, $url); curl_setopt($this->curl, CURLOPT_POST, 1); curl_setopt($this->curl, CURLOPT_REFERER, $referer); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $fields); curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Expect:')); return $this->request(); } function getInfo($info) { $info = ($info == 'lasturl') ? curl_getinfo($this->curl, CURLINFO_EFFECTIVE_URL) : curl_getinfo($this->curl, $info); $info = ($info == 'http_code') ? curl_getinfo($this->curl, CURLINFO_HTTP_CODE) : curl_getinfo($this->curl, $info); return $info; } function request() { return curl_exec($this->curl); } } ?>