jkmcgrath Posted May 31, 2008 Share Posted May 31, 2008 Hi, I can open this link int i.e.7 http://69.42.56.202:27012/ARCALive?id=livedata and it returns xml. If you notice, the root has a "-". I can save the page as xml and the "-" is gone and it passes xml validation. Now when I try to open that same url with by any other means it times out. I have tried, fopen and DOM load and loadxml but nada. I can open it from a saved xml file but not by the url provided. I am really stuck and have exhausted searching on google, php and here as well. My biggest problem is that I just dont know what method I need to use. Thanks in Advance, John Link to comment https://forums.phpfreaks.com/topic/108149-stuck-trying-to-open-url-for-xml-parsing/ Share on other sites More sharing options...
Prismatic Posted May 31, 2008 Share Posted May 31, 2008 Works fine <?php print_r( simplexml_load_string( file_get_contents("http://69.42.56.202:27012/ARCALive?id=livedata") ) ); ?> Link to comment https://forums.phpfreaks.com/topic/108149-stuck-trying-to-open-url-for-xml-parsing/#findComment-554361 Share on other sites More sharing options...
DarkerAngel Posted May 31, 2008 Share Posted May 31, 2008 Follow his suggestion and if your talking about the"-" provided in the screen shot, that's not actually in the document, browsers just add that for the possibility to collapse elements for easier reading of XML Documents [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/108149-stuck-trying-to-open-url-for-xml-parsing/#findComment-554364 Share on other sites More sharing options...
jkmcgrath Posted May 31, 2008 Author Share Posted May 31, 2008 Works fine <?php print_r( simplexml_load_string( file_get_contents("http://69.42.56.202:27012/ARCALive?id=livedata") ) ); ?> Thanks for the quick replies! Man what am I doing wrong? Here is the link http://mcfastracing.com/simxml.php I just cut and pasted your code like so; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <?php print_r( simplexml_load_string( file_get_contents("http://69.42.56.202:27012/ARCALive?id=livedata") ) ); ?> </body> </html> And I get this; Warning: file_get_contents(http://69.42.56.202:27012/ARCALive?id=livedata) [function.file-get-contents]: failed to open stream: Connection timed out in /home/mcfastra/public_html/mcfastracing.com/simxml.php on line 11 Link to comment https://forums.phpfreaks.com/topic/108149-stuck-trying-to-open-url-for-xml-parsing/#findComment-554384 Share on other sites More sharing options...
Prismatic Posted May 31, 2008 Share Posted May 31, 2008 It's a problem on your end, code runs fine on my server Link to comment https://forums.phpfreaks.com/topic/108149-stuck-trying-to-open-url-for-xml-parsing/#findComment-554386 Share on other sites More sharing options...
jkmcgrath Posted May 31, 2008 Author Share Posted May 31, 2008 Roger that thanks. Seems like knownhost blocks everything from running. Not really happy with them lately. Link to comment https://forums.phpfreaks.com/topic/108149-stuck-trying-to-open-url-for-xml-parsing/#findComment-554396 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.