[PHP] Logs de ip en .txt

Iniciado por ANTRAX, Febrero 24, 2010, 11:26:14 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Febrero 24, 2010, 11:26:14 AM Ultima modificación: Marzo 27, 2014, 06:12:42 PM por Expermicid
bueno, emmm vamos de 1 al code no tengo ganas de hablar xD

[index.php]

Código: php

<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

<?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);

?>


$host=gethostbyaddr($ip);

agregale esto asi agregue el host tmb es una forma ahy varias

Codigo Corregido, arreglados muchos fallos.

Se nota el copy and paste.
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login