This program only returns the client machine name in localhost only
echo gethostbyaddr($_SERVER['REMOTE_ADDR']);
If it is run from an online server, then computer name is not shown and some other information is being shown. So is there anyway to get the computer name in php when the program runs from online server.
Use the superglobal $_SERVER . Most important for your purpous I guess would be $info->platform . It will be very unlikely to retrieve a SPECIFIC device name from this.
What's this "other information"? An IP address?
In PHP, you use $_SERVER['REMOTE_ADDR']
to get the IP address of the remote client, then you can use gethostbyaddr()
to try and conver that IP into a hostname - but not all IPs have a reverse mapping configured.
Not in PHP.phpinfo(32)
contains everything PHP able to know about particular client, and there is no [windows] computer name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With