Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- //Configuracion de la conexion a base de datos
- $usuario_bd = 'root';
- $passwd_bd = '123456';
- try {
- // print "Conectando";
- $conn = new PDO('mysql:host=localhost;dbname=taller_4;charset=utf8', $usuario_bd, $passwd_bd);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- } catch (PDOException $e) {
- print "¡Error!: " . $e->getMessage() . "<br/>";
- die();
- }
- //variables POST
- $user = $_POST['user'];
- $nombre = $_POST['nombre'];
- $apellido = $_POST['apellido'];
- $foto = $_POST['foto'];
- $region = $_POST['region'];
- echo "Usuario: ".$user."<BR>";
- //registra los datos del empleados
- $sql = "INSERT INTO usuario (user, nombre, apellido, foto, region) VALUES ('$nombre_usuario', '$nombre', '$apellido', '$foto', '$region')";
- mysql_query($sql,$conn) or die('Error. '.mysql_error());
- //include('consulta.php');
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement