On Wed, 2004-02-04 at 19:59, Richard Miller wrote: > WORKS: > curl --cookie "WSJIE_LOGIN=blahblahblah" -L -O > "http://online.wsj.com/home/us" > > DOESN'T WORK: > $url = "http://online.wsj.com/home/us"; > $filename = "wsj.html"; > $mycookie = "blahblahblah";
Is that just short hand? You mean "WSJIE_LOGIN=blahblahblah", right? > $ch = curl_init(); > > curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); > curl_setopt($ch, CURLOPT_URL, $url); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > curl_setopt($ch, CURLOPT_COOKIE, $mycookie); // "works" if I remove > this line > > $content = curl_exec($ch); > > curl_close($ch); > > > When I run the PHP it doesn't load anything and eventually times out. > If I comment out the CURLOPT_COOKIE line, then the script works fine > and the page loads. But then, of course, the page that loads is the > login page instead of the actual content I want. Run a packet sniffer such as ethereal[1] on your machine and compare the requests. I ran both your examples and they each worked for me. I can't see what could be different, but it seems obvious that *something* has to be. A sniffer should show that. Corey ____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
