[Gllug] php, Apache and relative paths.

Simon Stewart sms at lateral.net
Thu Jan 24 18:10:10 UTC 2002


On Mon, Jan 21, 2002 at 05:25:58PM +0000, Tom Gilbert wrote:
> * Simon Stewart (sms at lateral.net) wrote:
> > <!-- This link points to /var/www.ukadis/htdocs/secure/page.html -->
> > <p>This is a <a href="/secure/page.html">link</a>
> > 
> > <? 
> > // Whereas this points to exactly where it says on the local FS
> > include "/secure/page.html"; 
> > ?>
> 
> <?php
>   # Whereas this is what you'd probably want
>   include $GLOBALS["DOCUMENT_ROOT"] . "/secure/page.html";
> ?>

Well, if they were one and the same file, then, yes, that would be
what you wanted. Prolly my bad idea to give both pages the same name
in my example. 

The "include" example is normally something that I use to load global
config details and utility routines, which I normally store in an
".inc" file outside of the main document tree --- there's often
sensitive information there that you don't ever want people
accidentally seeing. For some reason, I've never really got into the
habit of "include"ing page snippets, though I can see where it would
be useful.

Cheers,

Simon

-- 
The steady state of disks is full.
		-- Ken Thompson

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list