I’m new to php and web coding so any help would be great.
I’m having some issue with the transmission of an xml string between an iOS app and my webserver.
When sending the xml request I get a response starting with:
<b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 1: parser error : String not started expecting ' or "
<b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: <?xml version=\"1.0\"?> in
<b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 1: parser error : Malformed declaration expecting version in
I use the Google GDataXMLNode from the Google Data API to produce the XML on the iOS app.
I then send the xml using a post HTTP request.
The server uses php with:
$xml = simplexml_load_string($xml_string);
I believe the issue is with the xml string and the ” marks around the version number such as
<?xml version="1.0"?>
being sent as:
<?xml version=\"1.0\"?>
The strange thing is the code works fine on my local EasyPHP server, I only have issues when running it on my 1&1 webserver. Maybe it is the version of simplexml and php on the server?
How can I fix this, I believe I don’t have the ability to alter the php version on the 1&1 webserver.
Would it be better to use a different library to produce the xml, (I am looping through an array to produce it)
I’d guess this has something to do with:
http://php.net/manual/en/security.magicquotes.php
and if so, try:
http://www.php.net/manual/en/security.magicquotes.disabling.php