canadabeeau Posted December 12, 2009 Share Posted December 12, 2009 How can I get the MAC (Physical Network Address) of the computer visiting my website? I do remember seeing it done in JavaScript but now cant find the website (cant remember the name of it). Can anyone hlep, I need to display it on a php page, but I don't care how it is obtained and gets there. Thanks in advance, any advice welcomed Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/ Share on other sites More sharing options...
thebadbad Posted December 12, 2009 Share Posted December 12, 2009 AFAIK that's only possible if the visiting computer is on the same physical network as the server. Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-975944 Share on other sites More sharing options...
JAY6390 Posted December 12, 2009 Share Posted December 12, 2009 Yeah I'm fairly certain this info isn't passed to the server Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-975946 Share on other sites More sharing options...
cags Posted December 12, 2009 Share Posted December 12, 2009 It's certainly not possible with PHP since it is client side information. PHP is server side and as such only has information sent to it in headers by the browser, the MAC address is most certainly not one of these things. It's also not to my knowledge possible via JavaScript directly. Since you say you wish to use it to validate a specific person, the method described in this article may be appropriate for you. Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-975947 Share on other sites More sharing options...
Deoctor Posted December 12, 2009 Share Posted December 12, 2009 the javascript will do it out..I am not an expert of javascript,but i got this for one of my programs <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title></title> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> <meta name="vs_targetSchema" content="http://schemas. microsoft.com/intellisense/ie5"> <script id="clientEventHandlersJS" language="javascript"> <!-- function Button1_onclick() { var locator = new ActiveXObject "WbemScripting.SWbemLocator"); var service = locator.ConnectServer("."); var properties = service.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration"); var e = new Enumerator (properties); document.write("<table border=1>"); dispHeading(); for (;!e.atEnd();e.moveNext ()) { var p = e.item (); document.write("<tr>"); document.write("<td>" + p.Caption + "</td>"); document.write("<td>" + p.IPFilterSecurityEnabled + "</td>"); document.write("<td>" + p.IPPortSecurityEnabled + "</td>"); document.write("<td>" + p.IPXAddress + "</td>"); document.write("<td>" + p.IPXEnabled + "</td>"); document.write("<td>" + p.IPXNetworkNumber + "</td>"); document.write("<td>" + p.MACAddress + "</td>"); document.write("<td>" + p.WINSPrimaryServer + "</td>"); document.write("<td>" + p.WINSSecondaryServer + "</td>"); document.write("</tr>"); } document.write("</table>"); } function dispHeading() { document.write("<thead>"); document.write("<td>Caption</td>"); document.write("<td>IPFilterSecurityEnabled</td>"); document.write("<td>IPPortSecurityEnabled</td>"); document.write("<td>IPXAddress</td>"); document.write("<td>IPXEnabled</td>"); document.write("<td>IPXNetworkNumber</td>"); document.write("<td>MACAddress</td>"); document.write("<td>WINSPrimaryServer</td>"); document.write("<td>WINSSecondaryServer</td>"); document.write("</thead>"); } //--> </script> </head> <body> <INPUT id="Button1" type="button" value="Button" name="Button1" language="javascript" onclick="return Button1_onclick()"> </body> </html> try this in IE 7 or 6,, in ie 8 it might not work.. Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-975950 Share on other sites More sharing options...
canadabeeau Posted December 12, 2009 Author Share Posted December 12, 2009 Anymore suggestions? Or is there a way to get a unique code from the router (physical address/MAC) that the client PC is connected to instead? I need some way of identifying the person viewing, as IPs are not static (mostly) so for my purposes IPs would be uslesess Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-975963 Share on other sites More sharing options...
cags Posted December 12, 2009 Share Posted December 12, 2009 There is no way short of giving the person something to identify themselves. In theory you can do it with a cookie. Just assign a unique value to that person using a cookie and you know it's almost certainly them. Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-975975 Share on other sites More sharing options...
canadabeeau Posted December 12, 2009 Author Share Posted December 12, 2009 but they can delete the cookie, as most people or anitvirus/spyware may do automatically. I do remember a JS way exists but need to know how to do it.... Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-975984 Share on other sites More sharing options...
PFMaBiSmAd Posted December 12, 2009 Share Posted December 12, 2009 The only known ways of getting the MAC address is if you install a 'helper' application on the client. Either an Active X Object (which is essentially what ym_chaitu posted) or a Java applet (not to be confused with Javascript) (requires the Java VM to be installed on the client as well in order to run the Java applet.) Why exactly do you need a fool proof unique identifier, because you cannot install own application that you create to do this, an Active X Object, or a Java applet/Java VM on a client without their interaction and approval. Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-976001 Share on other sites More sharing options...
canadabeeau Posted December 13, 2009 Author Share Posted December 13, 2009 PFMaBiSmAd/Anyone can you suggest where I cn get the Java Aplet from or Active X method? I will just design my script so until they approve the applet they can not access the site. Quote Link to comment https://forums.phpfreaks.com/topic/184876-client-details/#findComment-976337 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.