How do I get reliable COMPUTERNAME?

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

 



I want to store the name of the computer that is executing a script in
some log tables. (Our servers are load balanced, and I'd like to be
able to determine which physical machine is serving each request.)

On my development machine (Windows PC running the debugger in Zend
Studio), I can find the name in three places:

getenv('COMPUTERNAME')
$_ENV['COMPUTERNAME']
$_SERVER['COMPUTERNAME']

On the development server, only the first works; $_ENV and $_SERVER
both return NULL and throw an undefined index notice.

I'm concerned about the reliability of all of these methods, since it
seems that they are not always available and all three can be easily
overridden inside a script. However, I notice that the header
generated by phpinfo() remains correct even when I manually spoofed
all three values on my development machine. Is there a reliable way to
find this value?

Andrew

-- 
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