Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/10/2006, 09:42
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Ok si ya sabes como ver la direccion de email desde la cual se esta abriendo tu codigo es cosa facil, solo es cuestion de abrir un archivo de texto y recorrelo con un bucle, si encuentras la direccion, agregas uno al texto, si no agregas una linea con el correo y el numero uno, un ejemplo seria:

Código PHP:
$emailRef// Este va a ser el correo que le llega a tu script
$emailTxt "./emails.txt";

$emailArr file$emailTxt );
$found false;
for( 
$i 0$i count$emailArr ); $i++ ) {
     
$buff explode"|"$emailArr[$i] );
     
$email $buff[0];
     
$count = (int) $buff[1];
     if( 
$email === $emailRef ) {
          
$count++;
          
$emailArr[$i] = $email "|" $count;
          
$found true;
     }
}

if( 
$found ) {
     
$emailStr implode"\r\n"$emailArr );
     
$fh fopen$emailTxt"w" );
     
fwrite$fh$emailStr );
     
fclose$fh );
} else {
    
$fh fopen$emailTxt"a" );
    
$newcontent $emailRef "|1";
    
fwrite$fh$newcontent );
    
fclose$fh );