RE: [PHP] Re: Hostname

2004-12-15 Thread Robinson, Matthew



-Original Message-
From: Boget, Chris [mailto:[EMAIL PROTECTED] 
Sent: 15 December 2004 16:58
To: 'Jason Motes'; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Hostname

> > In earlier versions of PHP, you could use the $HOSTNAME global 
> > variable to get the server/machine name that is running Apache/PHP.
> > However, that variable is no longer working and I can't seem to find

> > a replacement in any of the super global variables.  Is there one?  
> > How can you get the server/machine name?
> $_SERVER['HTTP_HOST']
> $_SERVER['SERVER_NAME']

Interesting.  When I do:

print_r( $_SERVER )

both of the above print out the site name and not the host name.  For
example, the site name is 'mysite.mydomain.com' 
and the servername is 'machinebob'.  Each of the above print out
'mysite.mydomain.com' and not 'machinebob', which is what I was
expecting.

thnx,
Chris



This message has been checked for all known viruses by the CitC Virus
Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___


This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___

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



RE: [PHP] Re: Hostname

2004-12-15 Thread Boget, Chris
> > In earlier versions of PHP, you could use the $HOSTNAME global 
> > variable to get the server/machine name that is running Apache/PHP.  
> > However, that variable is no longer working and I can't seem to find a 
> > replacement in any of the super global variables.  Is there one?  How 
> > can you get the server/machine name?
> $_SERVER['HTTP_HOST']
> $_SERVER['SERVER_NAME']

Interesting.  When I do:

print_r( $_SERVER )

both of the above print out the site name and not the host
name.  For example, the site name is 'mysite.mydomain.com' 
and the servername is 'machinebob'.  Each of the above print
out 'mysite.mydomain.com' and not 'machinebob', which is 
what I was expecting.

thnx,
Chris


[PHP] Re: Hostname

2004-12-15 Thread Jason Motes
Chris Boget wrote:
In earlier versions of PHP, you could use the $HOSTNAME
global variable to get the server/machine name that is running
Apache/PHP.  However, that variable is no longer working
and I can't seem to find a replacement in any of the super global
variables.  Is there one?  How can you get the server/machine
name?
thnx,
Chris
$_SERVER['HTTP_HOST']
$_SERVER['SERVER_NAME']
http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.server
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php