Skip to content

Instantly share code, notes, and snippets.

@bitforth
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitforth/b75d21ed74b96fc1cf48 to your computer and use it in GitHub Desktop.
Save bitforth/b75d21ed74b96fc1cf48 to your computer and use it in GitHub Desktop.
<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>
<?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