Forum Moderators: coopster
All the best, Niklas
Warning: file_get_contents() [function.file-get-contents]: Unable to access xml/liveText.xml in /customers/example.com/example.com/httpd.www/seo/datasource.php on line 9
Warning: file_get_contents(xml/liveText.xml) [function.file-get-contents]: failed to open stream: No such file or directory in /customers/example.com/example.com/httpd.www/seo/datasource.php on line 9
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /customers/example.com/example.com/httpd.www/seo/datasource.php:12 Stack trace: #0 /customers/example.com/example.com/httpd.www/seo/datasource.php(12): SimpleXMLElement->__construct('') #1 {main} thrown in /customers/example.com/example.com/httpd.www/seo/datasource.php on line 12
The simpleXML php code:
//Get
$xmlFileData = file_get_contents("xml/liveText.xml");
//Simple XML parser
$xmlData = new SimpleXMLElement($xmlFileData);
$xmlPara = $xmlData->page->text; //The output [1][edited by: jatar_k at 2:01 pm (utc) on May 20, 2008]
print($xmlPara);
[edit reason] please use example.com [/edit]
It seems to be having a problem finding the file at one point. check the path and if it still doesn't work, try using the full path. Also check the permissions of the XML file to see if you can access it correctly.