gromer Posted September 27, 2007 Share Posted September 27, 2007 php version 4.3.9 I'm sending xome XML to a server who then sends XML back to me. I use fread and get the XML sent back and I can echo my $xml variable and it has the xml. I can then make a DOMDocument but when I use loadXML it stops and doesn't do anything after that line, including displaying the HTML I have below all my php code. Is there something I need to configure with php for loadXML to work? If so, how do I go about doing that? Thanks! $xmlRequest = fsockopen($hostname, $port); fputs($xmlRequest, $xmlToSend); while ($out = fread($xmlRequest, 1024)) { $xml .= $out; } fclose($xmlRequest); // Parse XML data and set session variables when needed and then redirect to arSummary.php. $xmlDoc = new DOMDocument(); $xmlDoc->loadXML("<?xml version=\"1.0\"?><employees><employee><name>Mike</name></employee></employees>"); echo $xmlDoc->saveXML(); Quote Link to comment https://forums.phpfreaks.com/topic/70953-solved-more-xml-issues-using-domdocument-to-parse-xml/ Share on other sites More sharing options...
BlueSkyIS Posted September 27, 2007 Share Posted September 27, 2007 php version 4.3.9 I think you need PHP 5+ for DOMDocument class. http://us2.php.net/dom Quote Link to comment https://forums.phpfreaks.com/topic/70953-solved-more-xml-issues-using-domdocument-to-parse-xml/#findComment-356707 Share on other sites More sharing options...
gromer Posted September 27, 2007 Author Share Posted September 27, 2007 php version 4.3.9 I think you need PHP 5+ for DOMDocument class. http://us2.php.net/dom Yikes, I'm retarded. I saw that earlier, but I was under the impression from another page I looked at made it look like 4.3.x was fine. Anything else I can use without upgrading my php? If not, how easy/hard is it to upgrade to the newest php 5 version? Also, couldn't I just do a side by side install so I can test out my current php to make sure everything works? Then migrate everything to php5 from php4? Ugh, I wish this site was in ASP Quote Link to comment https://forums.phpfreaks.com/topic/70953-solved-more-xml-issues-using-domdocument-to-parse-xml/#findComment-356712 Share on other sites More sharing options...
BlueSkyIS Posted September 27, 2007 Share Posted September 27, 2007 ASP = Windows...ugh. anyway... You can still do DOM XML stuff in PHP 4: http://us2.php.net/manual/en/ref.domxml.php I assume you're on Windows and I don't know anything about developing PHP on Windows, so I can't help there. If you're on Linux, it's pretty simple from command-line or very simple from WHM/CPanel. If you're on OS X, download and install MAMP and you can toggle back and forth between PHP 4 and PHP 5. Quote Link to comment https://forums.phpfreaks.com/topic/70953-solved-more-xml-issues-using-domdocument-to-parse-xml/#findComment-356721 Share on other sites More sharing options...
gromer Posted September 27, 2007 Author Share Posted September 27, 2007 ASP = Windows...ugh. anyway... You can still do DOM XML stuff in PHP 4: http://us2.php.net/manual/en/ref.domxml.php I assume you're on Windows and I don't know anything about developing PHP on Windows, so I can't help there. If you're on Linux, it's pretty simple from command-line or very simple from WHM/CPanel. If you're on OS X, download and install MAMP and you can toggle back and forth between PHP 4 and PHP 5. No, it's a Linux setup. It looks like domxml is working so far. Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/70953-solved-more-xml-issues-using-domdocument-to-parse-xml/#findComment-356740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.