curl-and-php
No MySQL data in cURL output [SOLVED]
Date: Wed, 23 Aug 2006 11:24:59 -0700 (PDT)
[Previously, Tex Wrote:]
>> Maybe this is a PHP issue. I'd love to post this on
>> php-general_at_list.php.net, but their mail list is
not
>> working.
Turns out this was a PHP issue after all. Thanks to
Linus at curl.haxx.se support for pointing me down the
right path.
I use session_start() and ob_start() in the beginning
of my conxritedwg.php. However, in my zeal to use
cURL, I completely ignored a straight PHP solution:
ob_get_contents()
Since all my output was buffered, including data from
MySQL, I simply did this:
<?php
// save the output buffer to a file
$doc_root = $_SERVER['DOCUMENT_ROOT'];
$fp = fopen("$doc_root/vccpmp3/dwgs/dwg$ID.html",
"w");
$buffer = ob_get_contents();
fwrite($fp, $buffer);
ob_end_flush();
?>
So, the moral of the story is if you want to capture
your OWN output and save to a file, try the PHP way
with ob_start/ob_get_contents.
However, now that I've spent over a week learning
cURL, I am definately going to use it. So many
projects, so little time....
Tex
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-08-23