This program only returns the client machine name in localhost only
echo gethostbyaddr($_SERVER[\'REMOTE_ADDR\']);
If it is run from an online s
gethostname() using the IP from $_SERVER['REMOTE_ADDR'] while accessing the script remotely will return the IP of your internet connection, not your computer.
gethostname()
$_SERVER['REMOTE_ADDR']