Coreye Posted December 28, 2007 Share Posted December 28, 2007 What would cause this error; Warning: simplexml_load_file() [function.simplexml-load-file]: ./core/xml2.php:37: parser error : Start tag expected, '<' not found in /home/scriptsc/public_html/projects/us/beta_1/user_system/index.php The line is: $core['XML'] = simplexml_load_file('./core/xml.php'); Heres the xml.php file: http://www.scriptscribes.net/projects/us/beta_1/user_system/core/xml.phps. Thanks, Corey Quote Link to comment https://forums.phpfreaks.com/topic/83436-warning-simplexml_load_file-help/ Share on other sites More sharing options...
corbin Posted December 28, 2007 Share Posted December 28, 2007 When simplexml loads a file, it doesn't parse it as PHP. That means it's actually loading that file, not what that file would output if PHP were parsing it. So, you need to either include that file and using ob_start and what not, capture the contents and parse them, or create a cron job to run the xml.php file and make it generate an xml file every x minutes. Edit: It's probably worth noting that there are other methods..... You could run it through the cmd line and pass it through the PHP CLI for example.... Or you could get it remotely with a self reference to your server (bleh I wouldn't do that), and I'm sure there's other ways, but the two I mentioned are the two I would probably consider. Quote Link to comment https://forums.phpfreaks.com/topic/83436-warning-simplexml_load_file-help/#findComment-424475 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.