Re: Find MAC Address in PHP
| From: | Nathaniel Hall | Date: | Tue, 24 Apr 2007 14:39:01 +0000 |
| Subject: | Re: Find MAC Address in PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-253590@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:I am attempting to find the MAC address of systems visiting my page from the local LAN. I have tried several things, but it appears it will not let me run system commands. For example, running <?php $MAC = system("arp 192.168.200.254"); echo $MAC; ?>" does not give me any output. I have copied arp to a place that the apache user can execute from and ensured arp is executable.Use exec and the extra args to get error codes. Can you run 'arp' and get what you want from command line? Can you 'su' to PHP user and *then* run it and get what you want? If not, you can't do that. I dunno what 'arp' is gonna give you, but I wouldn't think you'd in general have access to the MAC address of a visitor hardware... Nor should you, actually... But if you've got your boxes configured to let any ol' person run this 'arp' thing and reply with their MAC addresses, I guess it oughta work... Thanks for the help. I believe I have narrowed it down to SELinux keeping Apache from executing commands. Anybody had the same problem and know a fix?