View Full Version : navigation through folders

12-05-2008, 10:31 AM
hey guys i dont know what is wrong with this bit of code.

here is my file layout it goes
// \\
php xml
so data has both php folder and xml folder and im doing a check from inside php folder to a xmldoc in xml folder,

$xml = simplexml_load_file("../xml/users.xml") or die ("Fatal Error opening file");
$auth = $xml->xpath("user/username[text()='$username']/../password[text()='$password']/..")

the problem is in the 1st line, it cant find the xml file

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "../xml/users.xml" in /var/www/src/data/php/login.php on line 5
Fatal Error opening file

please help =(

12-05-2008, 04:15 PM
It's not saying it didn't find the file, just that it failed to load it. Is users.xml a well formed xml file? Try an extremely simple xml file (like one node) and see if that works.