I have a problem loading an external XML file.
When I open it in a browser, everything looks good. I tried to download the XML file and upload it on my own server. When I try to load the XML file from my server, everything works well.
Can somebody help me solve this problem, so that I can load it from the external server?
My code:
$oXML_cz = new SimpleXMLElement(file_get_contents('http://www.ticketportal.cz/xml/temp/partnerall1.xml?ID_partner=122')); foreach ($oXML_cz->event as $event_cz) { ...... }
file_get_contentsto fetch other remote files, which is an important possibility to rule out. What other steps have you tried to debug this? For instance, if you echo out the contents offile_get_contents('http://www.ticketportal.cz/xml/temp/partnerall1.xml?ID_partner=122'), do you get the expected XML? What is the exact error message you receive when trying to run the code posted here?echo, and should have been showing even in your previous code. Have you made sure your error logging or display is turned up to the max to ensure all messages are captured?