Re: Questions about $_SERVER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 12:15 AM +0200 8/29/10, Peter Lind wrote:
On 28 August 2010 23:45, tedd <tedd.sperling@xxxxxxxxx> wrote:

> So, I'm trying to figure out a compliment to $_SERVER['SERVER_NAME'] such as
 something like $_SERVER['REMOTE_NAME'].

 > Is there such a beast?

You're not making any sense. For the script on your local host to be
able to connect and communicate with the remote host, it would need to
know the name of the remote host. Hence, the local host already knows
the name and has no reason to ask the remote host for a name by which
to contact it.
 That's what I get from your description of the problem. You probably
want to clarify some things.

Regards
Peter

Peter:

Sorry for not making sense. But sometimes you have to confirm the players (both server and remote) in communications.

Try this -- place this script on your site:

<?php
print_r($_SERVER);
?>

You will note that:

[SERVER_NAME] => is the domain name of your site.

Also:

[SERVER_ADDR] => is the IP of your site. If you are on a shared host, then it will still be the IP of the main host.

Please note:

[REMOTE_ADDR] => is the IP of the remote server. It *will be* the IP of the remote main host regardless of if the requesting script is running on the remote main host OR is running under a remote shared host.

Here's an example:

My site http://webbytedd.com is running on a shared host.

The server address reported for this site is: 74.208.162.186

However, if I enter 74.208.162.186 into a browser, I do not arrive at webbytedd.com, but instead go to securelayer.com who is my host.

Now, if webbytedd.com was the requesting script, how could the original script know what domain name the request came from? As it is now, it can only know the main host ID, but not the domain name of the requesting script. Does that make my question any clearer?

So my questions basically is -- how can I discover the actual domain name of the remote script when it is running on a shared server?

I hope that makes better sense.

Cheers,

tedd

--
-------
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux