Underc0de

Programación Web => Back-end => Mensaje iniciado por: ANTRAX en Febrero 24, 2010, 11:26:14 AM

Título: [PHP] Logs de ip en .txt
Publicado por: ANTRAX en Febrero 24, 2010, 11:26:14 AM
bueno, emmm vamos de 1 al code no tengo ganas de hablar xD

[index.php]

Código (php) [Seleccionar]

<title>Te vamos a leer la ip ^^</title>
<center><code><h1>You re Loged ^^</h1></code></center>
<br>
<?php
include("logs.php");
?>



[logs.php]
Código (php) [Seleccionar]

<?php
$fo
=fopen("archivodelogs.txt","a") or die("no esta el archivo xD");
$ip=$_SERVER[REMOTE_ADDR];
$host=gethostbyaddr($ip);
$d=date("d-m-Y");

fputs($fo,"$d $ip $host");
fputs($fo,"\r\n");
fclose($fo);

?>

Título: Re:[PHP] Logs de ip en .txt
Publicado por: _katze_ en Marzo 08, 2010, 11:51:18 AM
$host=gethostbyaddr($ip);

agregale esto asi agregue el host tmb es una forma ahy varias
Título: Re:[PHP] Logs de ip en .txt
Publicado por: Jhonjhon_123 en Marzo 08, 2010, 02:42:40 PM
Codigo Corregido, arreglados muchos fallos.

Se nota el copy and paste.