Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > PHP: Сеть > curl и caйт на asp.net


Автор: fake2 16.2.2011, 19:49
захожу на сайт, хожу норм. по ссылкам, а на открытии формы, которая нужна вылетаю - пропадает авторизация. hidden поля при открытии формы не передаются, рефер норм,  все куки на месте. куда копать?

Автор: patap 17.2.2011, 10:23
взглянуть бы.., может каких-то заголовков не хватает, или чего-то ты пропустил

Автор: fake2 17.2.2011, 16:54
эту функцию неверно вызывал.
Код

    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);
    }
хотя и сейчас работает через раз. то вылетаю то нет.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)