Curl and

Miscellaneous code snippets and examples that members have posted

Curl and

Postby Vladinator » Fri May 04, 2007 10:55 pm

Here is what I have made:

Code: Select all
$ch curl_init();
$data curl_exec($ch);

I know how to make it beeing saved to a file using $data as content, but the
problem as you see is that $data contains an 500 error. I tried to make curl
get the url as Firefox, but then it showed blank.

Any ideas? :scratch:
Last edited by Vladinator on Fri May 04, 2007 10:55 pm, edited 1 time in total.
Vladinator Apprentice Apprentice
Posts: 2
Joined: Tue Jul 11, 2006 7:40 pm

Curl and

Postby vblars » Sun May 06, 2007 5:58 am

I try this and it didn't work on their page. Maybe it is because their page is in frames.

Code: Select all

function vWritePageToFile$sHTMLpage$sTxtfile ) {
$sh =          curl_init$sHTMLpage );
$hFile =                       FOpen$sTxtfile'w' );
curl_setopt$shCURLOPT_FILE$hFile );
curl_exec  $sh );
$sAverageSpeedDownload curl_getInfo$shCURLINFO_SPEED_DOWNLOAD );
$sAverageSpeedUpload   curl_getInfo$shCURLINFO_SPEED_UPLOAD );
'Average speed download == ' $sAverageSpeedDownload '<br>';
'Average Speed upload    == ' $sAverageSpeedUpload   '<br>';
$aCURLinfo curl_getInfo$sh );
print_r$aCURLinfo );
curl_close(  $sh );
FClose    (  $hFile );
'(<b>See the file  "'.$sTxtfile.'"  in the same path of the hosting'.
' to where this script PHP</b>).<br>';

vWritePageToFile'''blizzard.txt' );


Last edited by vblars on Sun May 06, 2007 5:59 am, edited 2 times in total.
User avatar
vblars Apprentice Apprentice
Posts: 50
Joined: Tue Jul 04, 2006 1:52 pm

Return to Code Cache

Who is online

Users browsing this forum: No registered users and 0 guests