Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/08/2009, 11:01
esdesign
 
Fecha de Ingreso: agosto-2009
Ubicación: Lanzarote - Canarias
Mensajes: 57
Antigüedad: 17 años, 1 mes
Puntos: 2
Respuesta: Problema con sentencia if else

Prueba haber asi
Código PHP:
<?php
 
    $link 
= mysql_connect("xxxxxxx","xxxxxxxxx","xxxxxxxxxx");
$db=mysql_select_db("xxxxxxxxxxxx",$link);
 
$b='SELECT * FROM quik_users WHERE username = "'.$_POST['Usuario'].'"';
$r = mysql_query($b);
 
if (
$z = mysql_num_rows($r)){
    echo 
"<script>alert('EL USUARIO YA EXISTE EN NUESTRO SISTEMA POR FAVOR INGRESAR USUARIO DIFERENTE');
                  window.location.href ='inscripcion.php';</script>"
;
        }else{
    
$max1 = mysql_query('SELECT max(id) id FROM quik_users');
    
$max = mysql_fetch_array($max1);
    
$hoy = getdate();
    
$datestp = mktime($hoy['hours']+1 , $hoy['minutes'], $hoy['seconds'], $hoy['mon'], $hoy['mday'], $hoy['year'] );
    
setlocale(LC_TIME, "Spanish");
    
$x = strtoupper(strftime("%Y-%d-%m %H:%M:%S",$datestp));
    
$m1 = $max['id'] + 1 ;
    
$b='INSERT INTO quik_users (id, name, username, email, password, usertype, block, sendemail, gid, registerDate, lastvisitDate, activation, params, profesion, pais, departamento, ciudad, direccion, telefono, celular, instituto1, cargo1, instituto2, cargo2, instituto3, cargo3) VALUES("'.$m1.'", "'.$_POST['Nombre'].'", "'.$_POST['Usuario'].'", "'.$_POST['email'].'", "'.md5($_POST['password']).'", "Registered","0","1","18","'.$x.'","0000-00-00 00:00:00","","", "'.$_POST['Profesion'].'","'.$_POST['Pais'].'","'.$_POST['Departamento'].'", "'.$_POST['Ciudad'].'","'.$_POST['Direccion'].'","'.$_POST['Telefono'].'", "'.$_POST['Celular'].'","'.$_POST['Instituto1'].'","'.$_POST['Cargo1'].'","'.$_POST['Instituto2'].'", "'.$_POST['Cargo2'].'","'.$_POST['Instituto3'].'","'.$_POST['Cargo3'].'")';    
    
$r = mysql_query($b);
    
mysql_close($link);
 
    
$nombre = $_POST['Nombre'];
    
$mail = $_POST['email'];
    
$empresa = $_POST['Profesion'];
    
    
$header = 'From: ' . $mail . " \r\n";
    
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
    
$header .= "Mime-Version: 1.0 \r\n";
    
    
$header .= "Content-Type: text/plain";
    
$mensaje = "Nombre de Usuario: " . $Nombre . " \r\n";
    
$mensaje .= "Profesion: " . $Profesion . " \r\n";
    
$mensaje .= "E-mail de Contacto: " . $email . " \r\n";
    
$mensaje .= "Fecha de Inscripcion: " . date('d/m/Y', time());
    
    
$para = 'correo electronico predeterminado';
    
$asunto = 'Inscripción WebSite';
    
mail($para, $asunto, utf8_decode($mensaje), $header);
    echo 
"Inscripcion Correcta"
    
}
?>