How to get system Mac Address in PHP

You can view demo and download how get system Mac Address using PHP:

// Turn on output buffering
//Get the ipconfig details using system commond
system('ipconfig /all');

// Capture the output into a variable
// Clean (erase) the output buffer

$findme = "Physical";
//Search the "Physical" | Find the position of Physical text
$pmac = strpos($mycom, $findme);

// Get Physical Address
//Display Mac Address
echo $mac;

//If you want you can track the page visitor's mac address and store in database
//Insert the visitor's mac address to database
// " INSERT INTO `table_name` (`column_name`) VALUES('".$mac_address."') ";

This is a simple and effective way of getting the client system Mac address using PHP. Hope it will help you.

Leave a Comment