User 5795558
User 5795558
Machacateclados
Machacateclados

Hola gente, que tal? Cuanto tiempo sin pasarme... bueno, he encontrado un código, pero tiene un error y no registra en la base de datos, tenía algunos fallos que yo he corregido, pero ya no se que mas hacer, aquí tenéis el código:

<html>
    <head><title>Página de Registro</title>
    </head>
    <body>
        <center><h1>Formulario de Registro</h1></center>
        <?php
        require('seguridad.php');
        require('includes/constantes.php');        $nombre_registrado = @$_POST['usuario'];
        $usuario = encriptacion(@$_POST['usuario']);
        $email = @$_POST['email'];
        $contrasena = encriptacion(@$_POST['contrasena']);
        if ($usuario == NULL || $email == NULL || $contrasena == NULL) {
            echo "<center><h2>Debe completar todos los campos</h2></center>";
        } else { 
            if (!validacionemail($email)) {
                echo "<center><h2>El email ingresado no es válido</h2></center>";
            } else {
                conectar_base_datos();
                $verificacion_existencia = mysql_query("SELECT usuario FROM cuenta WHERE usuario = '$usuario'");
                if (0 < mysql_num_rows($verificacion_existencia)) {
                    echo "<center><h2>El nombre de usuario ya existen en los registros</h2></center>";
                }               else {
                    require('validacion.php');
                    $cod_unico_usuario = substr(md5(rand()), 0, 16);
                    $validado = "NO";
                    if (enviar_correo($email, $usuario, $cod_unico_usuario)) {
                        echo "<center>Un correo de validación fue enviado a $email</center>";
                    } else {
                        $fecha_ingreso = date("Y-m-d h:i:s");
                        $last_update = time();
                        mysql_query("INSERT INTO cuenta (usuario,email,contrasena,dinero) VALUES ('$usuario','$email','$contrasena', 100)") or die("Error de registro usuario");
                        foreach ($edificios as $edificio=>$propiedad){
                            mysql_query("INSERT INTO edificios (usuario, edificio, nivel, costo, capacidad, tipo_recurso, prod_hora, cantidad) VALUES ('$usuario','$edificio', 0, 100, 100,'".$propiedad['recurso']."', 0, 0)") or die("Error de registro edificios");
                        }
            include('includes/integracion.php');
            ubicacion_mapa($usuario,$nombre_registrado);
                        echo "<center><h2>Usuario Registrado Correctamente</h2><a href='index.php'>Volver</a></center>";
                    }
                }
            }
        }
        ?>        <form action='registro.php' method='POST'>
            <table align="center">
                <tr>
                    <td>
                        Nombre Usuario:
                    </td>
                    <td>
                        <input type="text" name="usuario" size="15" maxlength="10">
                </tr>
                <tr>
                    <td>
                        Contraseña:
                    </td>
                    <td>
                        <input type="password" name="contrasena" size="15" maxlength="10">
                    </td>
                </tr>
                <tr>
                    <td>
                        Email:
                    </td>
                    <td>
                        <input type="text" name="email" size="15" maxlength="30">
                    </td>
                </tr>
            </table>
            <center><input type="submit" value="Registrarme"></center>
        </form>
    </body>
</html>
Avatar Image
@man / @woman
@man / @woman

Mejor... dinos el error y la parte del código donde esta...

ATENCIÓN: Este tema no tiene actividad desde hace más de 6 MESES,
te recomendamos abrir un nuevo tema en lugar de responder al actual
Opciones:
Ir al subforo:
Permisos:
TU NO PUEDES Escribir nuevos temas
TU NO PUEDES Responder a los temas
TU NO PUEDES Editar tus propios mensajes
TU NO PUEDES Borrar tus propios mensajes
Temas similares
TemaUsuariosRespuestasVisitasActividad
Por: , el 03/Dic/2009, 22:22
JAVA-LDEA llopisweb12kJan/10
Por: , el 02/May/2003, 08:21
MaIcOl x-lord12kMay/03
Por: , el 09/May/2010, 01:49
webadiction GestionXls12kMay/10
Por: , el 10/Ene/2009, 14:57
syantanib NoSetup.org aerialss8822kJan/09
Por: , el 13/Jul/2006, 14:47
todos_ocupados germangerman inigoruiz sk.valshk carlitos_mel103kJul/09