\n";
$header .= "Reply-To: $admin_email\n";
$header .= "X-Mailer: PHP/" . phpversion(). "\n";
$header .= "X-Sender-IP: $REMOTE_ADDR\n";
$header .= "Content-Type: text/html";
mail($email,PAGETITLE.": Newsletter registration","Thank you for your registration!
To remove your mail adress from the maillist click here
Your password to delete yourself: ".$pass."
See you at ".$hp_url,$header);
redirect('index.php?site=newsletter', 'thank you for your registration.');
} else redirect('index.php?site=newsletter', 'You are already registered.');
}
}
elseif($action=="delete") {
$ergebnis = safe_query("SELECT pass FROM ".PREFIX."newsletter WHERE email='".$_POST['email']."'");
$dn=mysql_fetch_array($ergebnis);
if($_POST['password'] == $dn[pass]) {
safe_query("DELETE FROM ".PREFIX."newsletter WHERE email='".$_POST['email']."'");
redirect('index.php?site=newsletter', 'Your mail adress has been deleted.');
}else redirect('index.php?site=newsletter', 'The mail/password didnt match.');
}
elseif($action=="forgot") {
$ergebnis = safe_query("SELECT pass FROM ".PREFIX."newsletter WHERE email='".$_POST['email']."'");
$dn=mysql_fetch_array($ergebnis);
if($dn[pass] != "") {
$email = $_POST['email'];
$pass = $dn[pass];
$header="From:".PAGETITLE."<$admin_email>\n";
$header .= "Reply-To: $admin_email\n";
$header .= "X-Mailer: PHP/" . phpversion(). "\n";
$header .= "X-Sender-IP: $REMOTE_ADDR\n";
$header .= "Content-Type: text/html";
mail($email,PAGETITLE.": Deletion key","You required your deletion key!
To remove your mail adress from the maillist click here
Your password to delete yourself: ".$pass."
See you at ".$hp_url,$header);
redirect('index.php?site=newsletter', 'The password had been send.');
}else redirect('index.php?site=newsletter', 'There is no such mail adress.');
}
else {
$bg1=BG_1;
$bg2=BG_2;
$bg3=BG_3;
$bg4=BG_4;
$usermail = getemail($userID);
$get_mail = $_GET['mail'];
if($get_mail == "") $get_mail = 'mail adress';
$get_pw = $_GET['pass'];
if($get_pw == "") $get_pw = 'del-key';
eval ("\$newsletter_title = \"".gettemplate("title_newsletter")."\";");
echo $newsletter_title;
eval ("\$newsletter = \"".gettemplate("newsletter")."\";");
echo $newsletter;
}
?>