if (!($fh = fopen($FILENAME, "w")))
die ("Could not open " . $FILENAME . "!");$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_URL, $WSJURL); curl_setopt($ch, CURLOPT_COOKIE, $mycookie); curl_setopt($ch, CURLOPT_FILE, $fh);
fclose($fh);
curl_exec($ch); curl_close($ch);
$fh2 = fopen($FILENAME, "r");
I guess I thought it was inefficient to write the curl output to disk and then read it back in again later. If you don't save the curl output to a file it is sent to stdout. Is there a better way?
Richard
On Feb 2, 2004, at 3:50 PM, Daniel Crookston wrote:
Why would using PHP's curl be inefficient? I've used it before and it works wonderfully. Dan
However, I would like to do this in PHP. It seems like using PHP's curl would be inefficient. Can I send a cookie and use fopen()?
Thanks, Richard
____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
