extract($_GET);
extract($_POST);
//$langue = "FR";
//var_dump($_GET);
//$url_formulaire = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
include_once("templates/credeco/include_php/dicofonction.inc.php");
include_once("templates/credeco/script_envoi_email/validation_adresse_email.inc.php");
?>
echo dico("titre_page_inscription"); ?>
switch($mode) //changer la valeur de mode
{
case "envoi": //envoie de l'e-mail
{
//echo "envoi ligne 26";
//****************************** ON TEST LES CHAMPS OBLIGATOIRES *************************************
if(empty($prenom))
{
$check = dico("message_champ_prenom");
}
elseif(empty($nom))
{
$check = dico("message_champ_nom");
}
elseif(empty($telephone))
{
$check = dico("message_champ_telephone");
}
elseif(empty($societe))
{
$check = dico("message_champ_societe");
}
//****************************** ON TEST LES CHAMPS OBLIGATOIRES *************************************
//***************************** ON TEST L'ADRESSE E-MAIL *********************************************************
elseif(VerifierAdresseMail($email_contact_newsletter)) // on teste l'e-mail renvoyé par le formulaire
{
//********************************** ECRIRE DB EMAILVISION ************************************
$emv_tag = "5B5334451A8085B5";
$emv_ref = "EdX7CqkdLT5h8SA9MOPeXjXSWkl5H6nH_zmsc6k-XbLcKVE";
$rCurl = curl_init();
curl_setopt($rCurl, CURLOPT_URL, "http://tre.emv3.com/D2UTF8"); //http://ase.emv3.com/D2UTF8
curl_setopt($rCurl, CURLOPT_HEADER, 0);
curl_setopt($rCurl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($rCurl, CURLOPT_POST, true);
curl_setopt($rCurl, CURLOPT_POSTFIELDS, "emv_tag=".$emv_tag."&emv_ref=".$emv_ref."&EMAIL_FIELD=".$email_contact_newsletter."&SOURCE_FIELD=".$email_source."&FIRSTNAME_FIELD=".$prenom."&LASTNAME_FIELD=".$nom."&EMVADMIN3_FIELD=".$telephone."&EMVADMIN1_FIELD=".$langue."&EMVADMIN2_FIELD=".$societe); //date("Y-m-d h:i:s")
curl_setopt($rCurl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($rCurl);
curl_close($rCurl);
//********************************** ECRIRE DB EMAILVISION ************************************
//echo $result;
if($result=="ok")
{
//echo "ok";
$check = dico("message_newsletter_merci");
}
elseif($result=="pas_ok")
{
//echo "pas_ok";
$check = dico("message_newsletter_inscription_echouee");
}
elseif($result=="double")
{
//echo "en double";
$check = dico("message_newsletter_deja_inscrit");
}
}
else // si l'e-mail renvoyé par le formulaire de contact pas valide
{
$check = dico("message_newsletter_email_non_valide");
}
//***************************** ON TEST L'ADRESSE E-MAIL *********************************************************
} // fin du case "envoi"
/*break;*/
default: // par défault on inclut le formulaire d'ajout d'abonné
{
//echo "default ligne 89";
?>
} // fin case default
break; // on quite le script default
} // fin du switch MODE
?>