Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/10/2007, 19:04
agush88
Invitado
 
Mensajes: n/a
Puntos:
Ayuda con este formulario!

gente ayuda! T.T

no me funciona esto!! alguien sabe algo?

tengo todo funcionande en appserv 2.5.5 asi como vino

gracias!

Código PHP:
<html>
<head>
<title>Tipitos!</title>
</head>
<body>
<?php if (!isset($_POST['enviado'])) { ?>
    <form action="crear.php" method="post">
        <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>Nombre:</td>
                <td><input type="text" name="user"></td>
            </tr>
            <tr>
                <td>Contraseña:</td>
                <td><input type="text" name="pass"></td>
            </tr>
            <tr>
                <td>Confirmar Contraseña:</td>
                <td><input type="text" name="pass2"></td>
            </tr>
            <tr>
                <td>Correo Electrónico:</td>
                <td><input type="text" name="mail"></td>
            </tr>
            <tr>
                <td>Sexo:</td>
                <td><select name="sexo">
                    <option value="h">Hombre</option>
                    <option value="m">Mujer</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td></td>
                <td align="right"><input type="submit" name="enviado" value="Registrarse!"></td>
            </tr>
        </table>
    </form>
<?php 
else {
    if (
$_POST['user']==NULL $_POST['pass']==NULL $_POST['pass2']==NULL $_POST['mail']==NULL $_POST['sexo']==NULL) { ?>
        Debes completar todos los datos! <br><a href="crear.php">Volver</a>
    <?php }
    else{
        echo 
$_POST['user']."<br>";
        echo 
$_POST['pass']."<br>";
        echo 
$_POST['pass2']."<br>";
        echo 
$_POST['sexo']."<br>";
        echo 
$_POST['mail']."<br>";
        echo 
"ok!";
        
mysql_connect('localhost''root''268573') or die (mysql_error()) or die (mysql_error());
        
mysql_select_db('tipitos') or die (mysql_error());
        
$sql_checkuser="SELECT user FROM `usuarios` WHERE `user` = '".$_POST['user']."' LIMIT 0, 30";
        echo 
$sql_checkuser;
        
$user_exist=@mysql_num_rows($sql_checkuser) or die (mysql_error());
        echo 
$user_exist;
        
$sql_checkmail="SELECT mail FROM `usuarios` WHERE `mail` = '".$_POST['mail']."' LIMIT 0, 30";
        
$mail_exist=@mysql_num_rows($sql_checkmail) or die (mysql_error());
        echo 
$mail_exist;
        if (
$user_exist>0) { ?>
            <br>El usuario ya existe.<a href="crear.php">Volver</a><br>
        <?php 
        $userok
=1;
        }
        if (
$mail_exist>0) { ?>
            <br>El correo electrónico ingresado ya está en uso.<a href="crear.php">Volver</a><br>
        <?php 
        $mailok
=1;
        }
        if (
$mailok=&& $userok=1){
            
?>Usuario y correo electrónico disponibles.<?php
        
}
        }
    }
    
    
?>
</body>
</html>