Ver Mensaje Individual
  #15 (permalink)  
Antiguo 25/04/2009, 00:57
Avatar de pacmanaman
pacmanaman
 
Fecha de Ingreso: marzo-2009
Mensajes: 84
Antigüedad: 15 años, 1 mes
Puntos: 3
Respuesta: registro de usuarios

Código PHP:
include("configText.php"); // Aca agregas a $_TextRegistroNuevo, $_TextRegistroInsertError, etc, de esta manera centralizas en uno o mas Archivos los textos que se muestran.

$password_ok TRUE;
$email_ok TRUE;

if(
strlen($password)<4)
    
$password_ok FALSE;
else
    if(
$password != $cpassword)
        
$password_ok FALSE;

$password sha1("CoriaWeb"); 

$checkemail mysql_query("SELECT email FROM usu WHERE email='$correo'");  
$email_exist mysql_num_rows($checkemail);  

if (
$email_exist>0
    
$email_ok FALSE


if(
$password_ok and $email_ok)
{
    
$query "INSERT INTO usu (password, email, ip, fecha) VALUES('$password','$correo','$ip', NOW())";  
    
mysql_query($query) or die(mysql_error());  

    
// Aca tendrias que verificar si el insert se realizo satisfactoriamente!

    
if($insert_ok)
        echo 
$_TextRegistroNuevo;
    else
        echo 
$_TextRegistroInsertError;
}
else
{
    echo 
$_TextRegistroPasswordError $_TextRegistroEmailError;    

__________________
(<++