Felix
Felix

Reputation: 3134

Detecting remote client name using PHP or Javascript

I need the remote client name (aka computer name) to save it into a database, I was looking into $_SERVER variables but it doesn't exist. How can I get this just using another PHP's function or even javascript if it is necessary.

Upvotes: 0

Views: 2260

Answers (1)

Sarfraz
Sarfraz

Reputation: 382696

If you need the remote name, you can use:

gethostbyaddr($_SERVER['REMOTE_ADDR']);

and if you need server/computer name, you can use:

echo php_uname();
echo php_uname('n');

Upvotes: 1

Related Questions