Welcome Guest, Not a member yet? Register   Sign In
Phil's cURL library
#1

[eluser]iloveci[/eluser]
hi guys,

I'm having trouble getting this to work for my needs. I have to access a website -> Login -> submit a post to a searchurl -> parse the results

The problem is when I no matter how I set out the $this->curl->post I just cannot manage to login.

Here is an example of the code
Code:
function test() {
            $this->load->library('curl');
            $this->curl->create('URL');
            $this->curl->option('buffersize', 10);
            $this->curl->option('useragent', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)');
            $this->curl->option('cookiefile', APPPATH . '/controllers/cookie.txt');
            $this->curl->option('cookiejar', APPPATH . '/controllers/cookie.txt');
            $this->curl->option('followlocation', 1);
            $post = array(post params);
            $this->curl->post($post);
            $this->curl->set_cookies('copied from firebug');
            echo $this->curl->execute();
            echo $this->curl->debug();
}
The Post Params & set_cookies params I copied from firebug's header request, Could this be a problem?

The frequent errors I'm getting is the response site will say cookies aren't enabled, OR the login details are incorrect (although they are 100%), I also occasionally get a The requested URL returned error: 411.

I understand not all of this may be a problem with the library but my bad knowledge of cURL but any help would be appreciated.




Theme © iAndrew 2016 - Forum software by © MyBB