Hola, podriais decirme como en PHP puedo saber la IP y MAC de los clientes que acceden a mi web?
Gracias.
| |||
Respuesta: reconocer la IP y MAC del cliente Hola , La ip la sacas del arreglo $_SERVER , por el lado de la MAC es imposible ya que es una identificación unica de la placa de red y privada , quizas utilizando algun activex con ASP.NET podes llegar a coonseguir la MAC o con java , pero con PHP IMPOSIBLE. Saludos! |
| |||
Respuesta: reconocer la IP y MAC del cliente Cita: la arp podria ser como dice en este post de este foroejecuta un comando arp de shell
Código:
espero y funcione yo no le he probado <? function returnMacAddress() { // This code is under the GNU Public Licence // Written by michael_stankiewicz {don't spam} at yahoo {no spam} dot com // Tested only on linux, please report bugs // WARNING: the commands 'which' and 'arp' should be executable // by the apache user; on most linux boxes the default configuration // should work fine // Get the arp executable path $location = `which arp`; // Execute the arp command and store the output in $arpTable $arpTable = `$location`; // Split the output so every line is an entry of the $arpSplitted array $arpSplitted = split("\n",$arpTable); // Get the remote ip address (the ip address of the client, the browser) $remoteIp = $GLOBALS['REMOTE_ADDR']; // Cicle the array to find the match with the remote ip address foreach ($arpSplitted as $value) { // Split every arp line, this is done in case the format of the arp // command output is a bit different than expected $valueSplitted = split(" ",$value); foreach ($valueSplitted as $spLine) { if (preg_match("/$remoteIp/",$spLine)) { $ipFound = true; } // The ip address has been found, now rescan all the string // to get the mac address if ($ipFound) { // Rescan all the string, in case the mac address, in the string // returned by arp, comes before the ip address // (you know, Murphy's laws) reset($valueSplitted); foreach ($valueSplitted as $spLine) { if (preg_match("/[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f]/i",$spLine)) { return $spLine; } } } $ipFound = false; } } return false; } ?> Última edición por GatorV; 20/11/2009 a las 11:15 |
| |||
Respuesta: reconocer la IP y MAC del cliente He conseguido reconocer las IPs de los clientes, pero la MAC esta mas complicado, segun he visto en la shell no reconoce el comando :S Última edición por GatorV; 20/11/2009 a las 11:15 |
| ||||
Respuesta: reconocer la IP y MAC del cliente Cita: Fijate en esta pagina: http://www.cualesmiip.com/Ahi te sacan la Mac con cualquier navegador, tiene que haber una forma ¿no? |