cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Help with cookies & cURL

From: AtomixNetwork Internet Services <atomixnetwork_at_gmail.com>
Date: Sun, 27 Nov 2005 19:39:30 +1300

hmm...

I think i fixed that by chmodding 777 to the cookie file. Now it doesnt
show the cookie enabled message.

It still doesnt let me login? Could someone have a look at this?

On 11/27/05, AtomixNetwork Internet Services <atomixnetwork_at_gmail.com>
wrote:
>
> Hi there,
>
> I am currently using this script:
>
> **********************************************
> <?php
> $cookie_file_path = "/home/letsgo/cookies/trademe";
>
> $LOGINURL = "http://www.trademe.co.nz/structure/login.asp";
> $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4 )
> Gecko/20030624 Netscape/7.1 (ax)";
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,$LOGINURL);
> curl_setopt($ch, CURLOPT_USERAGENT, $agent);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
> curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
> $result = curl_exec ($ch);
> curl_close ($ch);
>
> $LOGINURL = "http://www.trademe.co.nz/structure/login.asp";
> $POSTFIELDS =
> 'url=&test_auto=&email=my-email_at_email.com&password=uhh';
> $referer = "http://www.trademe.co.nz/structure/login.asp";
>
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,$LOGINURL);
> curl_setopt($ch, CURLOPT_USERAGENT, $agent);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_REFERER, $referer);
> curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
> curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
> $result = curl_exec ($ch);
> curl_close ($ch);
> print $result;
>
> ?>
>
> *******************************************
>
> But it seems like the site checks to see if the browser has cookies
> enabled as it says this on the site:
>
> Your browser does not have cookies<http://www.letsproxy.com/structure/helpdocs/default.asp?help_id=270#cookies>enabled. Trade Me may not function properly without cookies turned on.
>
> Is there a way to make cURL tell the site that it has cookies enabled?
>
> Thank you!
>

--
Anson Mok
AtomixNetwork Internet Services

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-11-27