RE: [PHP] site root variable (for Generic Unix and Windows)

From: Date: Mon, 19 Mar 2001 13:23:19 +0000
Subject: RE: [PHP] site root variable (for Generic Unix and Windows)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-44534@lists.php.net to get a copy of this message
you could make your links absolute ie.. /cat.html so if you're in http://green/admin/admin.html you would link to http://green/cats.html HTH M@ > I am developing a PHP site under windows which is going to be deployed > eventually on Unix (indeed when life gets less hectic will also > be developed > under Unix but that's another story). > > Anyway the header.html (included at top of every page) has links in it. > However depending where the page is which is including > header.html the links > (from a relative point of view) will be different. For example for the > index.php (which is in site root) the catalogue page is simply referred to > as cat.html but from admin.html (which is in the admin directory > under site > root) ../cat.html would be required. > > A way to get round this problem seems to be to have a variable > with the site > root in it (i.e. $siteroot = "c:/pages/") however this is causing > me a real > headache. using > > echo "<a href=\"" . $siteroot "/cat.php">Catalogue</a> > > renders href to c:/pages/cat.php but then the browser tries to > download the > page as a file. I have also tried > > $siteroot = "http://green/ > > (green being the domain) but this douse not work either. > > I would really like the solution to this to be platform independent. > > Ta in Advance, > ben > -- > ben.2.edwards@bt.com (ben@work until end March) > ben@videonetwork.org (ben@home) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#44534) next »