Re: getting current page url

From: Date: Fri, 28 Apr 2006 11:32:49 +0000
Subject: Re: getting current page url
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-234985@lists.php.net to get a copy of this message
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); Schalk wrote:
Greetings All, Possibly a very simple question but here goes. How would I code the following in PHP? if(window.location == (("http://www.epda.cc/index.php") ||
php doesn't know what the location url of a window is - it's doesn't even know a browser windwo exists (to php it doesn't actually exist) it does (often) know which url referred it to the current script and it knows which url was requested.
("http://www.epda.cc/"))) {
       $current_nav = "includes/home_nav.php";
} else {
       $current_nav = "includes/inside_nav.php";
} What I am trying to accomplish is something like this:
<?php      if(window.location == (("http://www.epda.cc/index.php") || ("http://www.epda.cc/"))) {
       $current_nav = "includes/home_nav.php";
} else {
       $current_nav = "includes/inside_nav.php";
} ?> <?php include($current_nav); ?>
conceptually those 2 bits of pseudocode are identical - at least to me.
Thanks!


« previous php.general (#234985) next »