PHP Mailing List

This is my PHP Mailing List that I wrote when I didn't feel like signing up for one of those Mailing List services.

Put this little bit of HTML on your webpage in the body wherever you want the box to sign up to be:

Code:
<p>Type in your email and hit enter to sign up for our mailing list!</p>
<form action="sent.php" id="mailinglist" method="post">
 <input type="text" name="mail" size="40">
</form>
Then create a file called list.txt for the emails, and a file called sent.php with the following in it:

Code:
<?php
$email = $_POST['mail'];
$date = date("F j, Y");
$all = "Email: " . $email . "\n";
$file = "list.txt";
$handle = fopen($file, "a+");
fwrite($handle, $all);
fclose($handle);
header ("Location: http://www.YOURWEBSITE'SHOMEPAGE.com");
    header("Content-type: text/plain");
    print_r(htmlspecialchars(print_r($_POST, 1)));
?>
Enjoy!

This is just to make a simple mailing list with PHP, nothing too advanced. To get the list of emails you have to open the file called list.txt

Thanks,

~Flareboy323