Re: Location

From: Date: Sat, 24 Feb 2001 05:44:06 +0000
Subject: Re: Location
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41440@lists.php.net to get a copy of this message
"Brandon Feldhahn" <BrandonFeldhahn@earthlink.net> wrote: > Im making a website and i want the viewer to know were he of she is, > what do i need to do to make a location bar (home > serverices ect...) > with the $PHP_SELF command, i wasent able to figure it out so i am > asking assistance from another person. A simple solution for a site with a small number of pages would be to create an array like the following: $location['/index.php'] = "Home"; $location['/services.php'] = "Services"; $location['/products.php'] = "Products"; Then use $SCRIPT_URL or a similar environment variable to display the proper label in the "location bar". <?php echo $location[$SCRIPT_URL]; ?> If you have a large number of pages (especially dynamically generated "virtual" pages) or sublevels to your site you'll probably want to use a more advanced solution. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/

« previous php.general (#41440) next »