Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ipaddress=$_SERVER['REMOTE_ADDR'];
- $macaddr=false;
- #run the external command, break output into lines
- $arp=`arp $ipaddress`;
- $lines = explode(" ", $arp);
- $macaddr = $lines[3];
- ?>
- <?php
- //RETURNS AN IP ADRES 127.0.0.1
- $ipaddress=$_SERVER['REMOTE_ADDR'];
- $macaddr = false;
- #run the external command, break output into lines
- $arp='arp ' . $ipaddress;
- //You're trying to explode `arp 127.0.0.1` with a space
- $lines = explode(" ", $arp);
- //$lines contains array(0 => 'arp', 1 => '127.0.0.1')
- //$lines[3] does not exist that's where the undefined offset is coming from.
- $macaddr = $lines[3];
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement