Re: Bestätigungslink SM PHP Script unvollständig
Verfasst: 20.04.2012, 11:33
Sorry hat sich alles erledigt. Fehler lag bei mir! Vielen Dank.
https://board.superscripte.de/
Code: Alles auswählen
if(isset($_POST["Katalog"])) {
$KatalogEMailAdresse = "katalog@xxx.com";
reset ($_POST);
$message = "";
while (list ($key, $val) = each ($_POST)) {
if($key == "Sprache") continue;
if($key == "Action") continue;
if($key == "SubmitBtn") continue;
if($key == "Newsletter" || $key == "Katalog" )
if($val == 1)
$val = "ja";
else
$val = "nein";
$message .= "$key: ".rawurldecode($val)."\n";
}
# Versenden der Mail
@mail($KatalogEMailAdresse, "Katalog", $message, "From: $KatalogEMailAdresse");
}
# will keinen newsletter?
if(!isset($_POST["Newsletter"]) && !isset($_GET["Newsletter"]) && isset($_POST["Katalog"]) ) {
if(isset($_POST["Katalog"])) {
if ($KatalogDankeSeite != "")
header("Location: $KatalogDankeSeite");
else
print "<b>Unser Katalog wird Ihnen zugeschickt!</b>";
}
exit;
}
Code: Alles auswählen
<?
#############################################################################
# SUPERMAILER SUBSCRIBE/UNSUBSCRIBE SCRIPT #
# Double-Opt-In #
# Copyright © 2001 - 2005 Mirko Boeer #
# http://www.supermailer.de/ #
# #
# Dieses Script kann kostenlos eingesetzt werden, jedoch muss dieser Header #
# im Script enthalten bleiben! #
# #
# Systemvoraussetzungen: PHP 4 und Windows/Unix #
# 30.09.2005 #
#############################################################################
error_reporting(0);
# Geben Sie die E-Mail-Adresse Ihres POP3/IMAP Postfachs an
# Enter the email address of your POP3/IMAP inbox
$Recipient="newsletter@xxx.com";
# Geben Sie die Seite an, die angezeigt werden soll, wenn eine ANmeldung erfolgte
# und an den neuen Abonnenten die E-Mail zur Bestätigung gesendet wurde
# Angabe mit http://
# Enter the page that should be shown if a recipient wants to subscribe to your recipients list
# and the confirmation is be sent.
# With http://
$ConfirmationMailSendOKPage="http://www.xxx.com/subscribe.htm";
# Geben Sie die Seite an, die angezeigt werden soll, wenn eine ANmeldung erfolgte
# Angabe mit http://
# Enter the page that should be shown if a recipient will bei added to your recipients list
# With http://
$SubscribeOKPage="http://www.xxx.com/thanks.htm";
# Geben Sie die Seite an, die angezeigt werden soll, wenn eine ABmeldung erfolgte
# Angabe mit http://
# Enter the page that should be shown of a recipients will be removed from you recipients list
# With http://
$UnsubscribeOKPage="http://www.xxx.com/unsubscribe.htm";
# Geben Sie die Seite an, die angezeigt werden soll, wenn eine UMmeldung erfolgte
# Angabe mit http://
$EditOKPage="http://www.xxx.com/edit.htm";
# Geben Sie die Seite an, die angezeigt werden soll, wenn eine Kataloganforderung erfolgte
# Angabe mit http://
$KatalogDankeSeite="http://www.xxx.com/katalog.htm";
# Geben Sie die Seite an, die angezeigt werden soll, wenn die E-Mail-Adresse aeusserlich nicht korrekt ist = Fehlerseite
# Angabe mit http://
# Enter the page that should be shown if an error ocurrs = email address not correct
# With http://
$ErrorPage="http://www.xxx.com/error.htm";
# Geben Sie den Betreff der Bestaetigungs-E-Mail an
# Enter the subject of confirmation email
$EMailSubject="Ihre Anmeldung zum Newsletter";
# Geben Sie die Datei mit dem Text für die Bestaetigungs-E-Mail an, die der neue Abonnent
# geschickt bekommt. Dies muss eine Textdatei sein, kein HTML!
# Beachten Sie, der E-Mail-Text muss den Platzhalter [BESTAETIGUNGSLINK] enthalten, damit der
# Abonnent in der E-Mail auch den Link für die Aufnahme in den Newsletter anklicken kann.
# Angabe mit http://
# Specify a plain text file that should be send as confirmation email. The text must contain
# the text [CONFIRMATIONLINK]. The text will be replaced with the cofirmation link.
# With http://
$EMailText="http://www.xxx.com/confirm.txt";
# Bei der Script-Generierung wird dieser Schluessel anhand des Datums/Uhrzeit erstellt,
# der Schluessel kann manuell geaendert werden, darf jedoch NIE leer sein.
$CryptKey="xx/xx/xxxxxxxxxxxxxxxxx";
########### Ab hier nichts mehr aendern #####################
# FALLS register_globals off
if (ini_get('register_globals') == 0) {
if ( isset($_GET['Action']) )
$Action=$_GET['Action'];
if ( isset($_GET['EMail']) )
$EMail=$_GET['EMail'];
if ( isset($_POST['EMail']) )
$EMail=$_POST['EMail'];
if ( isset($_POST['Action']) )
$Action=$_POST['Action'];
if ( isset($_GET['Format']) )
$Format=$_GET['Format'];
if ( isset($_POST['Format']) )
$Format=$_POST['Format'];
if ( (!isset($REMOTE_ADDR)) || ($REMOTE_ADDR == "") )
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
}
function CheckEMail($email) {
if (strpos($email, "@") === False)
return 0;
$s = substr($email, strpos($email, "@"), strlen($email));
if (count(explode(".", $s)) < 2)
return 0;
return 1;
}
function CheckForSpam($str) {
if ( eregi("from:",$str) || eregi("to:",$str) || eregi("multipart",$str) || eregi("cc:",$str) || eregi("bcc:",$str) )
return 1;
return 0;
}
# Crypt
$crypt = &new EncDec;
$crypt->hash = $CryptKey;
if(isset($_POST["Katalog"])) {
$KatalogEMailAdresse = "katalog@xxx.com";
reset ($_POST);
$message = "";
while (list ($key, $val) = each ($_POST)) {
if($key == "Sprache") continue;
if($key == "Action") continue;
if($key == "SubmitBtn") continue;
if($key == "Newsletter" || $key == "Katalog" )
if($val == 1)
$val = "ja";
else
$val = "nein";
$message .= "$key: ".rawurldecode($val)."\n";
}
# Versenden der Mail
@mail($KatalogEMailAdresse, "Kataloganforderung", $message, "From: $KatalogEMailAdresse");
}
# will keinen newsletter?
if(!isset($_POST["Newsletter"]) && !isset($_GET["Newsletter"]) && isset($_POST["Katalog"]) ) {
if(isset($_POST["Katalog"])) {
if ($KatalogDankeSeite != "")
header("Location: $KatalogDankeSeite");
else
print "<b>Unsere Katalog wird Ihnen zugeschickt!</b>";
}
exit;
}
if ( (!isset($Action)) || ($Action == "") ) {
print "Es wurde das Feld Action nicht übermittelt!";
exit;
}
if (($EMailText == "") || ($EMailSubject == "")) {
print "Fehler es ist kein E-Mail-Text oder kein Betreff für die Bestätigungs-E-Mail vorhanden.";
exit;
}
if ( (isset($EMail)) && ($Action=="confirmation") ) {
$EMail = $crypt->phpDecrypt(rawurldecode($EMail));
}
if ( (!isset($EMail)) || ($EMail == "") || ( !CheckEMail($EMail) ) ) {
if ($ErrorPage != "")
header("Location: $ErrorPage");
else
print "<b>Es wurde keine E-Mail-Adresse angegeben oder die E-Mail-Adresse liegt nicht im korrekten Format vor!</b>";
exit;
}