Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_host="localhost";
- $db_user="root";
- $db_password="123456";
- $db_name="Inscripcion";
- $db_table_name="Nuevo";
- $db_connection = mysqli_connect($db_host, $db_user, $db_password, $db_name);
- if (!$db_connection) {
- die('No se ha podido conectar a la base de datos');
- }
- $subs_name = utf8_decode($_POST['nombre']);
- $subs_last = utf8_decode($_POST['apellido']);
- $subs_email = utf8_decode($_POST['email']);
- $resultado = mysqli_query($db_connection, "SELECT * FROM Nuevo");
- if (mysqli_num_rows($resultado)>0)
- {
- header('Location: Fail.html');
- } else {
- $insert_value = "INSERT INTO Nuevo (Nombre, Apellido, email) values ('$_POSTname[nombre]','$_POST[apellido]','$_POST[email]')";
- $retry_value = mysqli_query($db_connection, $insert_value);
- if (!$retry_value) {
- //die('Error: '.mysqli_error());
- }
- header('Location: success.html');
- }
- mysqli_close($db_connection);
- ?>
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Formulario de Registro SCIII</title>
- <link href="estilos.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <div class="group">
- <form action="registro.php" method="POST" action="registro.php">
- <h2><em>Formulario de Registro</em></h2>
- <label for="nombre">Nombre <span><em>(requerido)</em></span></label>
- <input type="text" id="nombre" name="nombre" class="form-input" required/>
- <label for="apellido">Apellido <span><em>(requerido)</em></span></label>
- <input type="text" id="apellido" name="apellido" class="form-input" required/>
- <label for="email">Email <span><em>(requerido)</em></span></label>
- <input type="email" id="email" name="email" class="form-input" />
- <center> <input class="form-btn" name="submit" type="submit" value="Suscribirse" /></center>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement