|
Posted by -Lost on 06/08/06 08:00
> If I use this ""<?php echo $HTTP_SERVER_VARS['REQUEST_URI']; ?> I get a backslash
> berfore the URL.
> For example: I get this URL returned "/content" if the url requested is
> "www.domain/content". Is there a setting I can use to avoid the backslash ?
That is the REQUEST_URI. Everything *after* the domain.
Now, it depends on how much you need after the domain. For example, do you need just the
name of the file executing the script? Do you need everything after the domain, just
minus the first backslash?
You could try:
print basename($_SERVER['REQUEST_URI']);
// *OR*, PHP_SELF, SCRIPT_NAME, SCRIPT_FILENAME
print trim($_SERVER['REQUEST_URI'], '/');
Not to mention, you should use $_SERVER as it is more robust. The former cannot be used
privately without a global declaration.
-Lost
Navigation:
[Reply to this message]
|