Firstly , good day to everyone. I have this script which handles the login to my database : http://pastebin.com/ctUEczRf I used pastebin because it was too long to use code tags. When I run it It returns me this :
This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
I don't know how to solve it , I never used XML before. This was given to me along with the CMS.
The most common cause is encoding errors. There are several basic approaches to solving this: escaping problematic characters ( < becomes < , & becomes & , etc.), escaping entire blocks of text with CDATA sections, or putting an encoding declaration at the start of the feed.
Pasting the XML that's generated is probably what you'd need to do. My guess is that you are generating XML with multiple top-level elements; XML requires that you have a single wrapper element at the top level and have all other elements inside it: it's a tree, not a forest.
My second guess is that you are seeing the error in your Web browser, and it is not being generated by php at all; check your Web server error logs to make sure.
Look at the XML. It should look something like the following:
<block>
<item>Here's an item</item>
<item>Here's another item</item>
<item>Here's an item with some sub-items
<subitem>one</subitem>
<subitem>two</subitem>
</item>
</block>
The root of the XML document is the block
item; it's the item that encloses and surrounds all of the other items.
If you don't have a root - ie, if the code looks something like this:
<item>Here's a list of items</item>
<item>But there's no root element</item>
Then you'll get the error you describe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With