Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/08/2007, 16:16
Avatar de ginitofl
ginitofl
 
Fecha de Ingreso: diciembre-2006
Ubicación: Lima Perú
Mensajes: 349
Antigüedad: 17 años, 5 meses
Puntos: 22
Re: mail confirmacion Usuarios

HOLA VIVI LO QUE PUEDES HACER ES CREAR EN LA TABLA USUARIO UN CAMPO LLAMADO ALEATORIO, Y AL MOMENTO EN QUE UN USUARIO SE REGISTRA CREAS UN NUMERO ALEATORIO Y GUARDAS DICHO NUMERO EN EL CAMPO ALEATORIO. PARA CREAR EL NUMERO HACES DE ESTA FORMA:

Código PHP:
srand ((double) microtime() * 1000000);
do

    {

        
$aleatorio rand(0,32000);

        
$resultid mysql_db_query("TUBASEDEDATOS","Select * From USUARIOS Where aleatorio=" $aleatorio);

        
$dameFila=mysql_fetch_array($resultid); 

    }while (
$dameFila); 
lo que hace esto es crear un numero aleatorio y compara que este numero no exista en el campo aleatorio, espero me hayas comprendido, si tienes alguna duda no dudes en preguntar.