Re: getting current page url [RESOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Jochem Maas wrote:
do a search $_SERVER['PHP_SELF'] - it should answer all your question.

if in doubt a var_dump() can do wonders (in this finding out what kind of
info is generally available, e.g.:

<?php

echo '<pre>';
var_dump($_SERVER, $_REQUEST, $_ENV, $_POST, $_GET);

Thanks Jochem,

A combination $_SERVER['PHP_SELF'] and $_SERVER['QUERY_STRING'] did the trick:

<?php if(($_SERVER['PHP_SELF']) && (!$_SERVER['QUERY_STRING'])) {
       $current_nav = "includes/home_nav.php";
   } else {
       $current_nav = "includes/inside_nav.php";
   }
   ?>
   <?php include($current_nav); ?>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux