Rygard Posted February 9, 2010 Share Posted February 9, 2010 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 More sharing options...
trq Posted February 9, 2010 Share Posted February 9, 2010 Take a look at the mail function. Link to comment https://forums.phpfreaks.com/topic/191458-form-handlingemail-question/#findComment-1009274 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.