Advertisement
Mayk0

#; PHP Para ver IPS De vicitas a la website!

May 3rd, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. Con este codigo se guardan las visitas en un .txt (visitas.txt)
  2. <?php
  3. date_default_timezone_set('America/Argentina/Buenos_Aires');
  4. $fecha = getdate();
  5. $hora = ($fecha["mday"]."/". $fecha["mon"]."/". $fecha["year"]." - ". $fecha["hours"].":". $fecha["minutes"]."";
  6. $txt="La ip:".$_SERVER['REMOTE_ADDR']." ha entrado: ".$hora." Con el navegador:".$_SERVER['HTTP_USER_AGENT'];
  7. $fd = fopen ("visitas.txt", "a" or
  8. die("Problemas en la conexion";
  9. fputs($fd,"\n";
  10. fputs($fd,$txt);
  11. fclose($fd);
  12. ?>
  13. ----------------------------------
  14.  
  15.  
  16. y con este se envia a tu email
  17. ----------------------------------
  18. <?php
  19. date_default_timezone_set('America/Argentina/Buenos_Aires');
  20. $fecha = getdate();
  21. $hora = ($fecha["mday"]."/". $fecha["mon"]."/". $fecha["year"]." - ". $fecha["hours"].":". $fecha["minutes"]."";
  22. $txt="La ip:".$_SERVER['REMOTE_ADDR']." ha entrado: ".$hora." Con el navegador:".$_SERVER['HTTP_USER_AGENT'];
  23. mail("TU EMAIL","Visita","$txt";
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement