At 12:15 AM +0200 8/29/10, Peter Lind wrote:
On 28 August 2010 23:45, tedd <tedd.sperl...@gmail.com> 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.
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:
You will note that:
[SERVER_NAME] => is the domain name of your site.
[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.
[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
Here's an example:
My site http://webbytedd.com is running on a shared host.
The server address reported for this site is: 22.214.171.124
However, if I enter 126.96.36.199 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.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php