Jump to content

file-get-contents help?


moviedrome

Recommended Posts

Hi,

 

I wonder if someone can help me with a file-get-contents problem, is there a way around the filename too long error? If not, can someone suggest a better way I can get that xml file into an array?

 

 

Warning: file_get_contents(https%3A%2F%2Fusers.buy.at%2Fmgt%2Faffiliates%2Fcommission.php%3FEMAIL%3Dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%26EPASSWORD%3Dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%26ID%3Dxxxxxxxxxxxxxxxxxx%26DATEFROM%3D2008-04-01%26DATETO%3D2008-05-01%26ORDERBY%3Dtrans_date_time%26ORDERDIRECTION%3DASC%26PAGE%3Dall%26FORMAT%3DXML) [function.file-get-contents]: failed to open stream: File name too long in /home/fjnet/public_html/buyat.php on line 59

 

Thanks in advance

 

Link to comment
Share on other sites

I'm getting no errors, using PHP 5.2.2:

 

<?php
echo file_get_contents(urldecode('https%3A%2F%2Fusers.buy.at%2Fmgt%2Faffiliates%2Fcommission.php%3FEMAIL%3Dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%26EPASSWORD%3Dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%26ID%3Dxxxxxxxxxxxxxxxxxx%26DATEFROM%3D2008-04-01%26DATETO%3D2008-05-01%26ORDERBY%3Dtrans_date_time%26ORDERDIRECTION%3DASC%26PAGE%3Dall%26FORMAT%3DXML'));
?>

Link to comment
Share on other sites

my code is:

 

$xml = "https://users.buy.at/mgt/affiliates/commission.php?EMAIL=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&EPASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&ID=xxxxxxxxxxxxxxxxxx&DATEFROM=20{$startdate}&DATETO=20{$enddate}&ORDERBY=trans_date_time&ORDERDIRECTION=ASC&PAGE=all&FORMAT=XML";

return file(urlencode($xml));

print_r($xml);

 

Thanks :)

Link to comment
Share on other sites

Ok,

 

I've got rid of the urlencode and I now get

 

No such file or directory in /home/fjnet/public_html/buyat.php on line 59

 

But the link works when i paste it into my browser so i'm not entirely sure what the problem is.

Link to comment
Share on other sites

  • 4 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.