Php - curl bug?

It’s small enough to post, the curl just doesn’t return the whole contents of the file there’s like 10 lines missing in the middle of what it grabs from the remote site. (I need to display a remote page in my framework - mostly works :wink:

<?php echo '<?xml version="1.0" encoding="iso-8859-1"?> ';

$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, ‘’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$lines = array();
$lines = explode("\n", $file_contents);

// display file line by line
// nline becase baseref doesn’t work in some browsers…
foreach($lines as $line_num => $line) {
$nline = str_replace(‘displayitem’,‘’, $line);
echo ($nline);

//echo $file_contents;

Have you tried cURL’ing and checking it by eye?

Maximum Cash Discount on any plan with MAXCASH

Yep by hand does the same thing…

Problem is this version of php is so old I can’t even report it as a bug, they say upgrade first!

Maybe try setting a User-Agent field in the get:
curl -A “Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)” [ URL ]

It could be some characters are freaking it out. Try using “double quotes”.

Maximum Cash Discount on any plan with MAXCASH

BINGO - My friend!!!

curl_setopt ($ch, CURLOPT_USERAGENT, “Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)”)


Awesome. Happy cURLing!

Maximum Cash Discount on any plan with MAXCASH