Jump to content

folder navigation


ja660k

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.