Skip to content

Instantly share code, notes, and snippets.

@markdrake
Created November 21, 2014 18:35
Show Gist options
  • Select an option

  • Save markdrake/21f8a0ad8e3ed8dab5a5 to your computer and use it in GitHub Desktop.

Select an option

Save markdrake/21f8a0ad8e3ed8dab5a5 to your computer and use it in GitHub Desktop.

Revisions

  1. markdrake created this gist Nov 21, 2014.
    23 changes: 23 additions & 0 deletions notification.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@

    <?php // formulario.php
    // Para saber a donde apunta el formulario fijate en el atributo action del form:
    <form action="server/script.php" name='nombre_formulario'>

    </form>
    ?>

    <?php /* server/script.php */ // Aquí es a donde llega el form anterior
    if (isset($_POST['nombre_formulario'])) {
    // Valida tus datos aquí //
    // Guarda tus datos aquí //

    // Después de la validación y que la información fue guardada compon el correo: //
    $message = "Line 1\r\nLine 2\r\nLine 3";

    // In case any of our lines are larger than 70 characters, we should use wordwrap()
    $message = wordwrap($message, 70, "\r\n");

    // Send
    mail('caffeinated@example.com', 'My Subject', $message);
    }