Forum Moderators: coopster
got an include statement that goes:
include '_boilerplate/months.inc.php';
but it can't seem to find the file?
Have checked and rechecked the spelling of the directory (_boilerplate) and file name (months.inc.php) and that's fine.
Now, if I drop the include file months.inc.php into the root of the directory (same directory as the calling file), presto! perfect.
I've got other calling files with includes which reside other directories at the same level as "_boilerplate" that work (i.e. '_include_login/validate_login.php'), so I'm really at a loss why my call to '_boilerplate/months.inc.php' won't work.
Anyone got any ideas?
Neophyte
Set your includes path either in php.ini or in a .htaccess file and then every time you need to include a file, you do not need to specify a path regardless of where in your file hierarchy the calling file is:
include "file.php";
If you have many included files and want to further organize them, you can create subdirectories inside your default includes directory and then call:
include "file.php"; //for a file at the top level of your includes dir
include "somesubdir/file2.php"//for a file inside a subdirectory
by doing so you can get rid of the .inc extension since you know all files contained within your includes directory are included files && there should't be any scattered around.