ja660k Posted December 5, 2008 Share Posted December 5, 2008 hey guys i dont know what is wrong with this bit of code. here is my file layout it goes root || data // \\ 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 =( Link to comment https://forums.phpfreaks.com/topic/135642-folder-navigation/ Share on other sites More sharing options...
Prismatic Posted December 5, 2008 Share Posted December 5, 2008 $xml = simplexml_load_file("./xml/users.xml") or die ("Fatal Error opening file"); Link to comment https://forums.phpfreaks.com/topic/135642-folder-navigation/#findComment-706687 Share on other sites More sharing options...
rhodesa Posted December 5, 2008 Share Posted December 5, 2008 so, the script is in the PHP dir? at the top of the script, put the following code, and post what it prints: echo __FILE__.'<br>'; if(!is_dir('../xml')) die("XML Folder doesn't exist"); $file = "../xml/users.xml"; echo "Realpath: ".realpath($file)."<br>"; Link to comment https://forums.phpfreaks.com/topic/135642-folder-navigation/#findComment-706697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.