эту функцию неверно вызывал.
| Код | public function send_curl($post=true, $reffer=true, $send_cookie=true) { $this->_ch = curl_init(); curl_setopt($this->_ch, CURLOPT_URL, $this->_url); curl_setopt($this->_ch, CURLOPT_USERAGENT, $this->_agent); // curl_setopt($this->_ch, CURLOPT_COOKIESESSION, true); if ($send_cookie) { curl_setopt($this->_ch, CURLOPT_COOKIEFILE, $this->_cookie); } if ($reffer) { curl_setopt($this->_ch, CURLOPT_REFERER, $this->_reffer); } if ($post) { curl_setopt($this->_ch, CURLOPT_POST, 1); curl_setopt($this->_ch, CURLOPT_POSTFIELDS, $this->_post); } else { curl_setopt($this->_ch, CURLOPT_POST, 0); } curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($this->_ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($this->_ch, CURLOPT_COOKIEJAR, $this->_cookie); $this->_html = curl_exec($this->_ch); curl_close($this->_ch); }
|
хотя и сейчас работает через раз. то вылетаю то нет. |