Last active
August 29, 2015 14:02
-
-
Save bitforth/b75d21ed74b96fc1cf48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="formulario-inepto" action="procesar.php" method="POST"> | |
Nombre: <input type="text" name="nombre" placeholder="Escribe tu Nombre"/> | |
Telefono: <input type="tel" name="telefono" placeholder="(555)-555-5555" /> | |
<button value="Enviar Formulario"></button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('conexion.php'); // Definicion de bases de datos y demas boberias | |
$nombre = $_POST['nombre']; | |
$telefono = $_POST['telefono']; | |
// Tipico Insert de programador inepto | |
$insertQuery = "INSERT INTO Contactos(nombre, telefono) VALUES(:nombre, :telefono)"; | |
$stmt = $pdo->prepare($insertQuery); | |
$stmt->bindParam(':nombre', $nombre); | |
$stmt->bindParam(':telefono', $telefono); | |
$stmt->execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment