|
Posted by Rik on 06/17/07 13:20
On Sun, 17 Jun 2007 08:22:52 +0200, dorayme
<doraymeRidThis@optusnet.com.au> wrote:
> For many web sites hosted on Unix servers I use (happily) a
> construction like this for includes:
>
> <?php include ($_SERVER['DOCUMENT_ROOT'].'/includes/footer.inc');
> ?>
>
> But this does not work on Windows servers and it has always been
> a puzzle to me (yes, I have asked here and elsewhere before about
> the matter. I seem not to have appreciated any advice given, or I
> have forgotten it). Anyone know a reliable way to state the path
> absolutely on a Windows server so I can use the same construction
> on each page with assurance the server can find the folder which
> contains all the includes?
It works on Windows for me, with Apache though. On another webserver it
might be diffent. print_r($_SERVER) to see what data it holds, if that
doesn't work, I've had good luck with getenv('DOCUMENT_ROOT').
--
Rik Wasmus
Navigation:
[Reply to this message]
|