Ver Mensaje Individual
  #6 (permalink)  
Antiguo 02/10/2005, 12:16
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 19 años, 5 meses
Puntos: 39
Consultando con mi camaradas rusos, uno de ellos dio el sgte codigo:
Código PHP:
$time1=time();    
$time2=time();    
if (!
$user[$REMOTE_ADDR]) {//si no hay ese IP, lo insertamos
$pol=mysql_query("INSERT  into table values('','$user','$time1','')");    
setcookie("users"$user);    
$auth="OK";    
}    
$out mysql_query("SELECT id,user,time FROM table WHERE user='".$_COOKIE['users']."'");    
if (
mysql_num_rows($out) == 1) {    
        
$auth="OK";    
echo 
"el usuario esta!";    
}    
if(
$auth=""){    
echo 
"se fue!";    
//registramos la hora de salida
$pol=mysql_query("INSERT  into table values('','$user','$time1','$time2') WHERE user='".$_COOKIE['users']. "' ");    

Este script usa cookies!
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.