Jump to content

PHP and XML, dumb problem


Recommended Posts

Hi guys,

I want to read a MYSQL data and then output it as a XML file....


Easy right?


Well, I reduced the coding to this simplest thing:


header("Content-type: text/xml"); 

echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";

echo "<slide_show>";
    echo "<photo>./images/DCP_0730.jpg</photo>";
echo "</slide_show>";



But it still doesnt work.


In Firefox I get:

XML Parsing Error: not well-formed

Location: http://liguedhockeysimule.x10hosting.com/default.xml

Line Number 7, Column 7:

echo "<slide_show>";



In IE 8 I get:

The XML page cannot be displayed

Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.





Invalid at the top level of the document. Error processing resource 'http://liguedhockeysimule.x10hosting.com/default.xml'....


echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";






I looked and looked, still cant seem to find the error....

I am pretty sure it is really a dumb mistake that I made somewher  :oops:


But I cant find it,

I changed the code to single qutoes, back to to double....

But I guess I need to  :banghead:  or something....

You can't imagine how stupid I feel lol

Thanks for your help,


Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.