Hi!
I am not sure if I correctly understand what you need, but it seems to me that you are definitively going in the wrong direction. Do you need to log the MAC address of the site visitor to the DB or your NIC's address? You should always understand "ipconfig /all" gives you YOUR NIC's MAC, not the one of someone talking to you.
If you need the MAC by IP and you know that this IP belongs to someone currently talking to you it surely must be in the ARP cache of you box, so you need
1) Get the IP of the guy
2) Crawl the ARP cache by IP
Code:
zyv:# arp -a | grep "192.168.101.57"
? (192.168.101.57) at 00:05:5D:33:XX:FF [ether] PERM on br0
So basically you need something like this:
PHP Code:
<?php
$dirty = `arp -a | grep "192.168.101.57"`;
// Returns: "? (192.168.101.57) at 00:05:5D:33:C8:FF [ether] PERM on br0"
ereg ("([0-9A-Fa-f]{2}(:?)){6}", $dirty, $reg);
$mac = $reg[0];
// Now go ahead with your DB stuff
// ([0-9A-Fa-f]{2}(:?)){6} basically that matches the MAC, we could me more accurate => secure, but I don't care, I trust ARP output.
?>
Hope that answers your questions.