I’m building a site that uses a number of file includes that work fine if I use the full path:
include (“http://www.mysite.co.uk/includes/”);
or even if I do the following:
include (“../../includes/”);
But I’m sure that these aren’t good ways to include files, especially as the site gets larger with more files and subdirectories. My problem is that linking files relative to my server root:
include (“/includes/”);
doesn’t work as the files cannot be found. I’m sure that probably the best way around this (as someone in another message suggests) would be to count the / characters in $PHP_SELF, but I’m having a bit of a brain dead moment and can’t think how I could do this!!
Can someone help me?
Cheers
Rob