Re: Questions about $_SERVER
| From: | Per Jessen | Date: | Sat, 28 Aug 2010 19:41:39 +0000 |
| Subject: | Re: Questions about $_SERVER | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307726@lists.php.net to get a copy of this message | ||
tedd wrote:
> Hi gang:
>
> The server global:
>
> $_SERVER['SERVER_ADDR']
>
> Provides the IP of the server where the current script is executing.
>
> And, the server global:
>
> $_SERVER['REMOTE_ADDR']
>
> Provides the IP of the server executing the script.
Yes, aka the client address.
> As such, you can enter the IP of either into a browser and see that
> specific domain.
Huh? If my server is 192.168.29.104 and my client is 192.168.29.114, I
might get the default website on the server address, and nothing on the
client (assuming it is not running a webserver).
> However, that doesn't work when you are dealing with shared hosting.
> Doing that will show you to the parent domain, but not the child
> domain (i.e., alias).
>
> So, how can I identify the exact location of the 'server_addr' and of
> the 'remote_addr' on shared hosting? Is that possible?
$_SERVER['SERVER_NAME'] will tell you the name of the virtual host - I
don't know if that is what you're after.
--
Per Jessen, Zürich (12.2°C)