File: /home/cstehnfp/lgos-rdc.com/newsletter.php
<?php
$page_id=8;
$mysqli=new sqlite3('admin_lgos/bdd_lgos.sq3');
include ('config.php');
include ('html1.php');
include ('topbar.php');
include ('navbar.php');
include ('header2.php');
$sc=0;
if (!isset($_POST["code"])) { $code = ""; }else{ $code = $_POST['code']; }
if (!isset($_POST["code2"])) { $code2 = ""; }else{ $code2 = $_POST['code2']; }
$code3=md5($code);
if (!isset($_POST["nemail"])){
$nemail = "";
$s=1;
}else{
$s=0;
$nemail=htmlspecialchars($_POST['nemail']);
$sde=vemail($nemail);
$noteko="";
if($nemail==""){ $s=1; $noteko="$noteko $Saisissez $votre e-mail!<br>";}
if($sde==0 AND $nemail!=""){$s=1; $noteko="$noteko $Saisissez $correctement $votre e-mail!<br>";}
if($code=="" || $code2!=$code3){
$code = gen_reg_key(4);
$code2 = md5($code);
$s=1; $noteko="$noteko $Saisissez $le code $code";
}
}
if($s!=1){
$tablerep=$mysqli->query("SELECT id FROM $table_mailing WHERE email='$nemail'");
$nombreentrees=nbre($tablerep);
if($nombreentrees!=0){$s=1;$noteko="$emailenregistre";}
if($nombreentrees==0){
$insert=$mysqli->query("INSERT INTO $table_mailing (temps,lang,email) VALUES ('$temps','$refl','$nemail')");
//envoi_mail
$message_mail="Salut!
<br>On vient de s'inscrire dans le newsletter du site $titre_site!
<br>E-mail : $nemail, Langue : $languem";
$sujet_mail="$titrenewsletter2";
include ('f_email.php');
$destinataire_mail="$nemail";
$sujet_mail="$titrenewsletter";
$message_mail="$txttitrenewsletter";
include ('f_email.php');
$noteok="$Merci_pour_votre_abonnement";
$redir="index.php?&l=$l";
refresh2($redir,$tempsrr);
}
}
include ('oko2.php');
if($s==1){ $BB="$Subscribe"; $TT="$Our_Newsletter"; $PP="$nbnewsletter";
include ('subscribe.php'); }
include ('footer.php');
unset($mysqli);
include ('html2.php');
?>