Newsletterbestellung
Bitte schicken Sie mir monatlich den evolutionen-newsletter via eMail zu.
// Standardfunktionen des Formulars
// !Hier nicht unbedingt ändern!
$MISSING = array();
$REQUEST = array();
$ERRORMESSAGE = "";
function isValidEmail($email){
// implemented conforming RFC822 by Cal Henderson (http://iamcal.com/publish/articles/php/parsing_email)
$qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]';
$dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]';
$atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c'.
'\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+';
$quoted_pair = '\\x5c[\\x00-\\x7f]';
$domain_literal = "\\x5b($dtext|$quoted_pair)*\\x5d";
$quoted_string = "\\x22($qtext|$quoted_pair)*\\x22";
$domain_ref = $atom;
$sub_domain = "($domain_ref|$domain_literal)";
$word = "($atom|$quoted_string)";
$domain = "$sub_domain(\\x2e$sub_domain)*";
$local_part = "$word(\\x2e$word)*";
$addr_spec = "$local_part\\x40$domain";
return preg_match("!^$addr_spec$!", $email) ? 1 : 0;
}
function checkRequest()
{
global $_REQUEST;
global $REQUEST;
global $MISSING;
foreach($REQUEST as $variable)
{
switch($variable[3])
{
case "email": if(!isValidEMail($_REQUEST[$variable[0]]))
$MISSING[] = $variable[0];
break;
default:
if($variable[1] && empty($_REQUEST[$variable[0]]))
{
$MISSING[] = $variable[0];
};
};
};
if(count($MISSING) > 0)
{
return false;
}else
return true;
};
function renderMissing()
{
global $MISSING;
global $ERRORMESSAGE;
$missing = "";
foreach($MISSING as $variable)
{
if($missing != "")
$missing .= ", ";
$missing .= $variable;
};
if($missing != "")
{
return(str_replace("[VAR]", $missing, $ERRORMESSAGE));
}else
return false;
};
function renderRequest()
{
global $_REQUEST;
global $REQUEST;
global $MISSING;
$requestmessage = "";
foreach($REQUEST as $variable)
{
$requestmessage .= str_replace("[VAR]", stripslashes($_REQUEST[$variable[0]]), $variable[2]);
};
return $requestmessage;
};
?>
// Konfiguration des Formulars
// | Name des Feldes | notwendig | Ausgabe in E-Mail
$REQUEST[] = array( "vorname", true, "Vorname: [VAR]\n");
$REQUEST[] = array( "name", true, "Name : [VAR]\n");
$REQUEST[] = array( "email", true, "email : [VAR]\n"."\n", "email");
$ERRORMESSAGE = '
Bitte alle Felder auszufüllen: [VAR]';
?>
// Versenden der Mail falls vollstädnige Daten und "Submit"
if($_REQUEST["submit"] && checkRequest() && (md5($_POST["code"])== "5e4ff841cf806b8f2d609c60932054b7"))
{
include("../inc/nl.php");
?>
Vielen Dank für Ihr Interesse.
}else
{
?>
// Ausgabe der Fehlermeldung
if(($missing = renderMissing()) !== false)
{
echo $missing;
};
?>
Abbestellung:
Wenn Sie den Newsletter abbestellen möchten, dann schicken Sie bitte einfach eine
eMail an unser Büro.
Weiterempfehlung:
Gefällt Ihnen unser Newsletter? Wer könnte ihn noch mit Gewinn lesen? Wir freuen uns über eine Empfehlung.