![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
08/02/2007, 23:23
|
| | Fecha de Ingreso: agosto-2003
Mensajes: 906
Antigüedad: 21 años, 5 meses Puntos: 3 | |
Re: Error al intentar mostrar usuarios online <?
require('conex_act.php');
$limite = time()-10*60;
global $REMOTE_ADDR;
$ip = $REMOTE_ADDR;
mysql_query("delete from visitantes where fecha < ".$limite, $db);
$result = mysql_query("select ip from visitantes where ip = '$ip'", $db);
if (mysql_num_rows($result) != 0){
mysql_query("update visitantes set fecha = ".time()." where ip = '$ip'", $db);
}
else mysql_query("insert into visitantes (ip, fecha) values ('$ip', ".time().")", $db);
echo "".mysql_result(mysql_query("SELECT COUNT(ip) FROM visitantes", $db), 0)."";
?> |