Jump to content

Form Handling/Email Question


Rygard

Recommended Posts

Ok, I think this should be pretty easy...

I wrote a simple PHP script to handle an HTML, and I want to be emailed each time a user submits the form.  Any help would be great!

 

Here is the script:

<?php

    if($_POST['tourney1sub'] == "Submit") {

      $varName = $_POST['firstname'];

$varLastName = $_POST['lastname'];

$varEmail = $_POST['email'];

$varLevel = $_POST['level'];

 

 

 

      $errorMessage = "";

 

    }

if($errorMessage != "")

{

  echo("<p>There was an error:</p>\n");

  echo("<ul>" . $errorMessage . "</ul>\n");

}

else

{

  $fs = fopen("childrens.csv","a");

  fwrite($fs,$varName . ", " . $varLastName . ", " . $varEmail . ", " . $varLevel . "\n");

  fclose($fs);

 

  header("Location: thankschildrens.html");

  exit;

}

 

?>     

Link to comment
https://forums.phpfreaks.com/topic/191458-form-handlingemail-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.