// Report all PHP errors (see changelog) error_reporting(E_ALL); ?> $badEmail=false; $email=''; if (!empty($_REQUEST['doit'])) { $email = $_REQUEST['email']; if (filter_var($email, FILTER_VALIDATE_EMAIL)) { // Append to end of file $myFile = "../../fakedb/flandersballad.db"; $fh = fopen($myFile, 'a') or die("can't open file"); fwrite($fh, $email . "\n"); fclose($fh); echo "Thank you. We will send you a note at " . $email . " when the song is ready for download."; die(); } else { $badEmail=true; } } ?>