echo gethostbyaddr($_SERVER['REMOTE_ADDR']); echo gethostname(); // may output e.g,: sandie // Or, an option that also works before PHP 5.3 echo php_uname('n'); // may output e.g,: sandie
This work locally not server
Server Error Note:
PHP Notice: Undefined index: REMOTE_ADDR in /home/UMAQ6W/prog.php on line 4 PHP Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/UMAQ6W/prog.php on line 4
Hit me with a comment!