Re: getting current page url [RESOLVED]
| From: | Schalk | Date: | Fri, 28 Apr 2006 12:24:59 +0000 |
| Subject: | Re: getting current page url [RESOLVED] | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-234988@lists.php.net to get a copy of this message | ||
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