Re: Name of page itself? [message #177231 is a reply to message #177213] |
Thu, 01 March 2012 12:01 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma:
|
Senior Member |
|
|
El 28/02/2012 10:58, Sonnich Jensen escribió/wrote:
> I have not worked with PHP for 2+ years, now again and need to refill
> my brain...
>
> How can I get the name of the main page?
>
> Say, index.php includes menu.php, how do I get the name of the main
> page, in this case index.php?
If I understood correctly, it'll be one of these:
$_SERVER['SCRIPT_FILENAME']
$_SERVER['SCRIPT_NAME']
$_SERVER['PHP_SELF']
Please note that they all refer to the _file_ name (which can show up
the URL or not).
If it isn't any of them:
print_r($_SERVER);
> Next say page1.php, page2.php etc?
No entiendo :-?
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|