1

I am trying to get the users machine name by using

gethostbyaddr($_SERVER['REMOTE_ADDR']);

but all I get is the host name which is the same for all users in my wireless network. I googled and some say it is not possible to get the users local machine name on wireless environment..

Is there any other way to get the machine name on wireless environment?

Is that even possible? Thanks in advance.

omerdoron
  • 25
  • 7

1 Answers1

0

You'll need some kind of scan, nmap or any other depending of your environment. You didn't said if your server is under Windows or what OS.

I'm supossing you are trying to get netbios names.

On windows you can launch a nbtstat command using php exec or similar function and get the output and parse it.

A manual about how to do that: http://www.onlinecomputertips.com/networking/nbtstat.html . Anyway is easy nbtstat -A <ip>

On linux you have more options but for sure, nmap could be one but probably is simpler for your case to use nbtscan, just launch nbtscan <ip>, and the same... launch it from php, save the output and parse it.

OscarAkaElvis
  • 5,384
  • 4
  • 27
  • 51