Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/83436-warning-simplexml_load_file-help/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

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