Forum Moderators: coopster
Rather n00b question I have.
You know how it is possible to link to domain-relative files using a '/' in HTML? (eg. to link to an image, you can do
<a href="/images/image.png">img</a>) Is there any way to accomplish the same thing in php using the include function? I've tried doing
include("/included_file.php");, but PHP doesn't like it at all. Thanks
*g
Luckily there is a simple way to do this and if you ever move to another server with a different path, it'll still work!
include($_SERVER['DOCUMENT_ROOT'] . '/included_file.php')