Xml.PHP Parse error!
- Started
- Last post
- 10 Responses
- Mishga
Hi Good people of Qbn!
My flash site is loading text data from a xml. For the cms i need to change the extension "myfile.xml" to "myfile.xml.php".
Works fine, but when i upload to the server and flash try to load the "myfile.xml.php", i get a :
"Parse Error: syntax Error, unexpected T_STRING in myfile.xml.php".Anyone?
Thanks!
- jpea0
Sounds like you have a quote out of place or missing somewhere on whatever line the error lists.
- welded0
Can you post a link to the XML?
- Mishga0
Here's my file before upload:
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<texto>My text...my text..mytext</texto><br />
<br />
</xml>When i open the file on the server code editor i get:
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<texto>My text...my text..mytext</texto><br />
<br />
</xml>i don't know why the server add ""...WTF?!?!
- welded0
Hm, wasn't expecting that... Are you sure the file is utf-8?
- Mishga0
Even if i delete the strange caracters added, i keep getting the same error...
:S
- Mishga0
Thanks Welded!!=) The strange caracters are gone!! =)
You were right i was using notepad++ ...(Damn!)But i still have the same issue..:S
i've created a new mimetype (text/x generic - .php), and the text is working...of course my PHP form is not working anymore..
I think the server cannot handle the xml code inside the PHP file...
Anyone?
- welded0
Well, I think I'm out of ideas... :p Without being able to try stuff myself I'm just guessing, but are you basically echoing the XML back as a regular string? We use PHP to funnel XML to Flash in a lot of work we do and I've always used PHP's SimpleXML functions and it works like a charm. Try starting here: http://php.net/simplexml specifically look at asXML()
- Mishga0
Ok..i'll check out the link..
Thanks a lot for your help Welded..=)
Cheers!!
- Mishga0
WWiiiii..i've got it...
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>in other words, the server was trying to parse <?xml... ?> as php.