Web Hosting Talk







View Full Version : Suscribing to e-mail button?


PDBRider
02-26-2005, 01:56 AM
How would i make it so that when someone typed in their e-mail it would like put this on a list for mass emailing?

Within flash?

eric1207
02-26-2005, 02:50 PM
flash is far beyond my knowledge and this is probably not going to help you at all, but i think this is what you want, only in php...


<?

if (($do == "add") && ($email)) {

if (!eregi(".+@.+\..+", $email)) {
echo "The email address is not valid.\n";

} else {

$file = "emails.txt";
$fh = fopen($file, "a");

if (fwrite($fh, "$email\n")) {
echo "Your email address was added.\n";
} else {
echo "There was an error while adding your email address";
}

fclose($fh);
}
} else {
?>
<form method="post" action"">
Newsletter<br>
<input type="text" name="email" size="35" maxlength="35"><br>
<input type="hidden" name="do" value="add">
<input type="submit" value="Subscribe">
</form>
<? } ?>