24 lines
700 B
PHP
24 lines
700 B
PHP
<?php
|
|
// inspired by https://www.mailgun.com/blog/email/double-opt-in-with-php-mailgun/
|
|
|
|
$domain = 'tobias-radloff.de';
|
|
$fromAddress = 'newsletter@tobias-radloff.de';
|
|
$siteURL = 'https://tobias-radloff.de';
|
|
$uniqueKey = '***REMOVED***'; // works like password salt
|
|
|
|
function SanitizeInputs($var) {
|
|
return = htmlspecialchars($var, ENT_QUOTES);
|
|
}
|
|
|
|
function SanitizeEmail ($var) {
|
|
$sane = htmlspecialchars($var, ENT_QUOTES);
|
|
$pattern = "/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$/";
|
|
preg_match($pattern, $sane, $res);
|
|
$r = $res[0] ? $res[0] : false;
|
|
return $r;
|
|
}
|
|
|
|
function CheckConfirmationHash($confEmail, $confCode) {
|
|
return (md5($confEmail . $uniqueKey) === $confCode);
|
|
}
|
|
?>
|