PHP and root?
Posted 06 April 2013 - 10:37 PM
I have been unsuccessfully trying to manage PHP to begin a path from the root directory. I have a structure like so
/ < ROOT
Index.php includes class.php which checks if image.png exists via file_exists() and does stuff. The problem is that this
returns bool(false) and in order to get a bool(true) i need to start from "Images/Image.png", but then if I call the class from somewhere else this wouldn't work, I suppose?
Posted 06 April 2013 - 10:41 PM
Posted 06 April 2013 - 10:43 PM
It is in htdocs, since I'm using xampp, to which I as well as HTML, unlike PHP, refer as root :?
Posted 06 April 2013 - 10:44 PM
The $_SERVER variables hold a lot of valuable information. The document root is one of them.
You mean that I need to use the absolutely absolute path even beyond the htdocs folder?
EDIT: I never expected I would need to go any deeper than the htdocs but that worked! Thanks
Edited by Manixat, 06 April 2013 - 10:45 PM.
Posted 06 April 2013 - 10:45 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users