StrangerInBeijing
Oct 25th, 2007, 03:14 AM
I am setting up a new website, that will run on a Win2K3 Server (some other system on the server need windows), so I will be using WAMP.
Not a php pro (yet), but from what I gathered one can set a specific folder to be your "includes" folder, so in any php page you can just say "include("myfile.php") and it does not matter in what directory you are, myfile.php will be included as long it exists.
Am I right, and if so, how do i do this?
Reason for this is that say I create a header for all pages in mysite/include/header.php. In header.php I include another file (say mysite/lang/en.inc). But now header.php cannot be re-used, if it's in a different directory level. (say i use it in a file, two levels deeper it will crash, because ../lang/incshould now be ../../../lang.php)
I'm fairly sure I just missed sth simple so far...this sounds like everyone should address this "issue"
Not a php pro (yet), but from what I gathered one can set a specific folder to be your "includes" folder, so in any php page you can just say "include("myfile.php") and it does not matter in what directory you are, myfile.php will be included as long it exists.
Am I right, and if so, how do i do this?
Reason for this is that say I create a header for all pages in mysite/include/header.php. In header.php I include another file (say mysite/lang/en.inc). But now header.php cannot be re-used, if it's in a different directory level. (say i use it in a file, two levels deeper it will crash, because ../lang/incshould now be ../../../lang.php)
I'm fairly sure I just missed sth simple so far...this sounds like everyone should address this "issue"