Find a client computer name

10.3k views Asked by At

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.

1

There are 1 answers

0
Néstor On

@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.