I have a slight problem, and after some reading on PHP.net I'm still unable to find out how to get past it. If I have a script that runs like this, www.mysite.com/product.php?id=games but I've mod_rewrite'ed the URL's so they turn out like www.mysite.com/products/games If I was to echo the current page in the footer like so: <?php echo $_SERVER['PHP_SELF'] ?> It echos product.php. Is there any way I can get it to echo www.mysite.com/products/games? Any help much appreciated. Thanks!
<?php echo $_SERVER['PHP_SELF'] . "?"; ?> will show what you want. But, this is a display only feature for the visitor. But, why the question mark?
PHP_SELF will show the name of the php script. REQUEST_URI will show the requested URI. <?php echo $_SERVER['REQUEST_URI']; ?> PHP:
Hmm, that doesn't do it quite right. Is there any way to echo the current page in how it reads in the actual address bar?