Find a client computer name

Axeem picture Axeem · Dec 19, 2013 · Viewed 10.3k times · Source

I want to find the client computer name. I am using php but it does not work well because it is server side language than I use javascript because it is client side.
I hava a code in javascript but it does not work.

 var network = new ActiveXObject('WScript.Network');  
   alert(network.computerName);  

Why this is not work please tell me.
If javascript can not do that then which language can do that.
Thanks.

Answer

Néstor picture Néstor · Jan 14, 2014

@Sachyn Kosare, gethostname is for get local machine name, nor client machine name.

nowadays we will cannot get the client machine name by js due for security reasons and actually activex such as wscript needs clients permissions to run and i don't know if actual IE versions lets run it.