Forum Moderators: coopster
i.e. php include("mainmenu.php") on all my pages etc.
Very handy, but is there a problem with using absolute links in it?
I have found that php include("http://www.example.com/mainmenu.php") doesn't work?
I'm wondering how to include appropriate files once the directory structure of the site gets more complex?
Thanks
Mr Cat
include '[b]/[/b]the-path/the-file-name.php'; instead.
Don't include the domain name.
There is never a need to include "http" because the file is included internally within the server. It isn't the browser fetching this individual file. It is the server doing all the work.
I usually have a special folder for include files, to keep them separate from the rest of the website.
[php.net...]
(Example #3)