Hi,
I am following a tutorial from a an Ajax/PHP book. I have written a script the generates an xml document. I keep getting the following error when I try to open the script in a browser (even when I download the code from the support site):
XML Parsing Error: junk after document element
Location: http://hapuk.coreware.co.uk/test/ajax/foundations/php/phptest.php
Line Number 2, Column 1:<b>Warning</b>: domdocument() expects at least 1 parameter, 0 given in <b>/home/chris/happenin/test/ajax/foundations/php/phptest.php</b> on line <b>5</b><br />
^
ie6 says:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
Only one top level element is allowed in an XML document. Error processing resource 'http://hapuk.coreware.co.uk/test/ajax/...
<b>Warning</b>: domdocument() expects at least 1 parameter, 0 given in <b>/home/chris/happenin/test/ajax/...
The code that is causing the error is:
// set the output content type as xml
header('Content-Type: text/xml');
// create the new XML document
$dom = new DOMDocument();
I'm assuming that there must be something wrong with the php installation on the server. Anybody got any ideas?