$email = $_REQUEST["email"];
if ((!isset($_POST['submit2']))) {
?>
} else {
// If someone wants to subscribe him/herself do the following:
// The "," sign is illegal ! Don't store address when it contains a ","
// We also know there hase to be a "@" and a "." in every Email address
$checksep = strpos($email, ",");
$checkAT = strpos($email, "@");
$checkPT = strpos($email, ".");
if ((! $checksep === false) || ($checkAT === false) || ($checkPT === false)) {
echo ' * ILLEGAL E-MAIL ADDRESS *'; exit; } // Check if an Email address has to be added to a new file or "," seperated to existing list $list = file_get_contents("maillist.php"); if (strlen($list) == 0){ $newitem = $email; } else { $newitem = ', '.$email; } // Add it to the file $openmail = fopen("maillist.php", "a+"); fwrite($openmail, $newitem); fclose($openmail); echo ' Your E-mail address: '.$email.' is added to the mailinglist'; // $list = file_get_contents("maillist.php"); // $list = str_replace(', ', ' ', $list); // echo ' Email addresses currently in mailist: '.$list; } ?> |