TeleQom.org/php/newsletter.php

19 lines
670 B
PHP
Raw Normal View History

2023-03-15 19:53:04 +00:00
<?php
2023-04-22 19:41:53 +00:00
require_once $_SERVER['DOCUMENT_ROOT'].'/config/PRIVATE/DB.php';
2023-03-15 19:53:04 +00:00
$lang_folder = $_GET['newsletter-language']=="fr"?"/pages/fr/":"/pages/en/";
2023-04-22 19:41:53 +00:00
if(!filter_var($_GET['newsletter-email'], FILTER_VALIDATE_EMAIL) || $_GET['newsletter-email-2'] != "") {
2023-03-15 19:53:04 +00:00
header('Location: '.$lang_folder.'err/general.html');
die();
}
2023-04-22 19:41:53 +00:00
$insert_email = $pdo->prepare('INSERT IGNORE INTO newsletter(email,language) VALUES (?,?)');
$insert_email->execute(array($_GET['newsletter-email'],$_GET['newsletter-language']));
if($insert_email->rowCount()==1){
2023-03-15 19:53:04 +00:00
header('Location: '.$lang_folder.'confirmation.html');
die();
}
header('Location: '.$lang_folder.'err/general.html');
?>