0) $comma = ", ";
$add = $comma.$email;
$emails = $filecontents.$add;
$file = @fopen($filename, "w+");
@fwrite($file, $emails);
@fclose($file);
$message = "Your email was added to the mailing list.".
" Redirecting to the last page.";
}
elseif ($_POST['choice'] == "leave") {
$edited = str_replace($email,"",$filecontents);
$file = @fopen($filename, "w+");
@fwrite($file, $edited);
@fclose($file);
$message = "Your email was removed from the mailing list.".
" Redirecting to the last page.";
}
mail("henesyfam@hotmail.com", "Newsletter Nofication", "This message has been automatically generated to inform you that $email has chosen to $choice the newsletter.");
}
?>
|