Jump to content

Parse XML


pedro84

Recommended Posts

Good day,

 

I use oempro software and try to parse XMLReturn but it's not working for me, simplexml_load_string return tons of errors. Maybe someone could help me?

 

pending.php?XMLReturn=<%3Fxml version%3D"1.0" encoding%3D"utf-8"%3F><response><Success><![CDATA[1]]><%2FSuccess><ErrorCode><![CDATA[0]]><%2FErrorCode><SubscriberID><![CDATA[11]]><%2FSubscriberID><RedirectURL><![CDATA[http%3A%2F%2Fflivoo.com%2Fcustomers%2Fmario%2Fpending.php]]><%2FRedirectURL><%2Fresponse>

 

This is how the GET string looks, how to parse it? :)

Link to comment
https://forums.phpfreaks.com/topic/187831-parse-xml/
Share on other sites

For examples sake (e.g. you're going to want to have validation for security):

 

<?php
if (!empty($_GET['XMLReturn']))
{
$queryString = urldecode($_GET['XMLReturn']);

$xml = simplexml_load_string($queryString);

header("content-type: text/xml");
echo $xml->asXML();
}
else
{
echo "XML Undefinded.";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/187831-parse-xml/#findComment-991725
Share on other sites

Archived

This topic is now archived and is 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.