Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <?php
- $usuario = $_POST['usuario'];
- $nombre = $_POST['nombre'];
- $apellido = $_POST['apellido'];
- $foto = 'fotiwi';
- $region = $_POST['region'];
- echo "usuario ".$usuario." Nombre ".$nombre." Apellido ".$apellido." foto ".$foto." region ".$region."asdssjhfjkadf";
- $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!: conexion " . $e->getMessage() . "<br/>";
- die();
- }
- $sql="INSERT INTO usuario (user, nombre, apellido, foto, region) VALUES ('".$usuario."', '".$nombre."', '".$apellido."', '".$foto."',".$region.")";
- try
- {
- $stmt = $conn->prepare($sql);
- $stmt->execute();
- } catch(PDOException $e)
- {
- print "¡Error!: agregacionnnnnnnmnjhjmjghmbhkkjgchd slzoyh " . $e->getMessage() . "<br/>";
- die();
- }
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement