R: [PHP] Get current URL
| From: | n e t b r a i n | Date: | Mon, 09 Oct 2000 13:07:16 +0000 |
| Subject: | R: [PHP] Get current URL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19151@lists.php.net to get a copy of this message | ||
Well,
about the request url, there is a way in order to get an HTTP_HOST var that
contains a user?
I mean:
for this http://user@myhost.com/ , I need to get the *user*
...
many thanks in advance
max
> That'll give you www.example.com/path/to/file.php?arg=val for example, but
> the http:// or https://
> isn't there. To see that, you'd need to check
> what $SERVER_PROTOCOL was (HTTP/1.0, for example), unless it's safe in
> your situation to just assume it'll be http.
>
> $SERVER_NAME doesn't include the port, so it isn't as reliable as
> $HTTP_HOST. Additionally, $SCRIPT_NAME doesn't include any get parameters
> that may have been sent.
>
> For a complete listing of all the variables available in your environment,
> load a page containing <?php phpinfo() ?> and look over the 'Apache
> Environment' section.
>
> Matt