Advertisement
Guest User

Codigo de IP , By Omar Rodriguez

a guest
Feb 3rd, 2013
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <body>
  2. <?php
  3. $ip = $_SERVER['REMOTE_ADDR']; //IP
  4. $meses = array('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'); //Meses
  5. $nombre = 'logs'; //Nombre de archivo
  6. $dia = date('d'); //Dia
  7. $mes = date('m') - 1; //Mes
  8. $ano = date('Y'); //Año
  9. $hora = date('h:i:s'); //Hora
  10. $file = fopen($nombre.'.txt', 'a+'); //Abrimos archivo
  11. fwrite($file, 'La IP '.$ip.' accedio el '.$dia.' de '.$meses[$mes].' del '.$ano.' a las '.$hora.""); //Guardamos información
  12. fwrite($file, "\r\n======================================================================". PHP_EOL);
  13. fclose($file);//Cerramos archivo
  14. ?>
  15. </body>
  16. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement