Shadowing Posted December 7, 2011 Share Posted December 7, 2011 Im using XAMPP at the moment and my applicatin im making is in a folder in the htdocs folder where all my files are read from. I notice when im php scripting if I put any files into another folder with in my main folder it wont load the page. so when I want to load a .php file from a script do i need to add more then just go to this .php file? I tried adding folder/*****.php but that didnt work I want to use multiple folders so its more organized hope someone can help me out with this Quote Link to comment https://forums.phpfreaks.com/topic/252668-using-folders-in-mysql/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted December 7, 2011 Share Posted December 7, 2011 ../******.php Quote Link to comment https://forums.phpfreaks.com/topic/252668-using-folders-in-mysql/#findComment-1295308 Share on other sites More sharing options...
Shadowing Posted December 7, 2011 Author Share Posted December 7, 2011 im trying to get headers in my php scripts to go to htdocs/game/map/*******.php if thats a better way of putting it Quote Link to comment https://forums.phpfreaks.com/topic/252668-using-folders-in-mysql/#findComment-1295309 Share on other sites More sharing options...
Shadowing Posted December 7, 2011 Author Share Posted December 7, 2011 thats wierd it works now lol. last night i was trying to load a background image and it didnt work but it works now. I must of misspelled the folder name or file. Quote Link to comment https://forums.phpfreaks.com/topic/252668-using-folders-in-mysql/#findComment-1295317 Share on other sites More sharing options...
ZulfadlyAshBurn Posted December 7, 2011 Share Posted December 7, 2011 LOL Quote Link to comment https://forums.phpfreaks.com/topic/252668-using-folders-in-mysql/#findComment-1295320 Share on other sites More sharing options...
Shadowing Posted December 7, 2011 Author Share Posted December 7, 2011 I just realize another problem now since im adding folders If I have a header going to folderA/folderB/file.php and while im reading that file if i have any php include files in the script it wont read it from folder B guess there is no way around that? Quote Link to comment https://forums.phpfreaks.com/topic/252668-using-folders-in-mysql/#findComment-1295491 Share on other sites More sharing options...
jcbones Posted December 8, 2011 Share Posted December 8, 2011 Yes, there is. Specify an absolute file path. Includes will always read according to the called script. So, if you have scriptA in folderA that includes a file in folderB, that includes another file from folderB. PHP will not find this file if it is passed a relative file path, because PHP will be looking in the directory that scriptA is residing in (folderA). To get passed this, you must specify an ABSOLUTE FILE PATH. include(dirname(__FILE__) . '/myincludedfile.php'); //will include a file in the same directory as the current file. include(dirname(__FILE__) . '/folderB/myincludedfile.php'); //will look on folder down for the file. Quote Link to comment https://forums.phpfreaks.com/topic/252668-using-folders-in-mysql/#findComment-1295588 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.