Skip to content

Instantly share code, notes, and snippets.

@azcdev
Last active August 29, 2015 14:02
Show Gist options
  • Save azcdev/b75d21ed74b96fc1cf48 to your computer and use it in GitHub Desktop.
Save azcdev/b75d21ed74b96fc1cf48 to your computer and use it in GitHub Desktop.

Revisions

  1. azcdev revised this gist Jun 10, 2014. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions procesar.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?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();
  2. azcdev created this gist Jun 10, 2014.
    5 changes: 5 additions & 0 deletions formulario.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <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>