|
Posted by .:J:. on 06/08/06 23:26
"-Lost" <spam_ninjaREMOVEME@REMOVEMEcomcast.net> wrote in message
news:C_WdnVr3C-maRBrZnZ2dnUVZ_q2dnZ2d@comcast.com...
>> 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
Hey 'Lost'
I'd need a little help here. I'd like to get everything but the domain and
the first backslash. As the example earlier, i'd like to get "content"
returned not "/content".
So, instead of writing:
<?php echo $HTTP_SERVER_VARS['REQUEST_URI']; ?>
I'd need to do what ?
Cheers
Jakob
Navigation:
[Reply to this message]
|