$login = $_POST['login']; $mdp = $_POST['mdp']; $nb_achat = 0; /* -----------------------------------------------------------------------------------------------------------------------------*/ /* fonction pour verifier la syntaxe d'email */ function VerifierAdresseMail($adresse) { $Syntaxe = '#^[\\w.-]+@[\\w.-]+\\.[a-zA-Z]{2,6}$#'; if (preg_match($Syntaxe, $adresse)) { return true; } else { return false; } } /* -----------------------------------------------------------------------------------------------------------------------------*/ if (is_numeric($cin) && is_numeric($tel) && VerifierAdresseMail($mail)) { if ($result = $mysqli->query("INSERT INTO client(nom ,prenom,adresse,mail,tel,cin,login,mdp,role,nb_achat)VALUES ('" . $nom . "','" . $prenom . "','" . $adresse . "','" . $mail . "','" . $tel . "','" . $cin . "','" . $login . "','" . $mdp . "','" . $role . "','" . $nb_achat . "')")) { } /* -----------------------------------------------------------------------------------------------------------------------------*/ //if($query = mysql_query($insertSQL) ){ //header("location:adminInscription.php"); echo "<script> window.location = 'http://localhost/naija/adminInscription.php';</script>"; ?> <script language="javascript" type="text/javascript"> alert("l'ajout est réussie !"); </script> <?php //} } } }
$mdp_bis = strip_tags($_POST['mdp_bis']); $adresse = strip_tags($_POST['adresse']); $cp = strip_tags($_POST['cp']); $ville = strip_tags($_POST['ville']); $_SESSION['insc_form']['nom'] = $nom; $_SESSION['insc_form']['prenom'] = $prenom; $_SESSION['insc_form']['email'] = $email; $_SESSION['insc_form']['email_bis'] = $email_bis; $_SESSION['insc_form']['adresse'] = $adresse; $_SESSION['insc_form']['cp'] = $cp; $_SESSION['insc_form']['ville'] = $ville; $_SESSION['inscription_error'] = ""; if (!VerifierAdresseMail($email) == false) { $_SESSION['inscription_error'] .= "Erreur de saisie du premier e-mail<br>"; } if (!VerifierAdresseMail($email) == false) { $_SESSION['inscription_error'] .= "Erreur de saisie du second e-mail<br>"; } if ($email != $email_bis) { $_SESSION['inscription_error'] .= "Les deux e-mail sont différents<br>"; } if ($nom == "") { $_SESSION['inscription_error'] .= "Champ Nom vide<br>"; } if ($prenom == "") { $_SESSION['inscription_error'] .= "Champ Prénom vide<br>"; } if ($mdp == "") { $_SESSION['inscription_error'] .= "Champ mot de passe vide<br>"; } if ($mdp_bis == "") {
<?php include_once "utile.php"; $titre = "Contact"; $description = "Contacter Christian MARQUAY, par messagerie interposée, par les réseaux sociaux, ou par un autre site web."; $h2 = "Email et réseaux sociaux"; $affichage = ""; if (isset($_POST["send"])) { if (isset($_POST["nom"]) && isset($_POST["email"]) && isset($_POST["sujet"]) && isset($_POST["message"]) && !empty($_POST["nom"]) && !empty($_POST["email"]) && !empty($_POST["sujet"]) && !empty($_POST["message"])) { $email = addslashes(htmlentities($_POST["email"])); if (VerifierAdresseMail($email)) { $nom = addslashes(htmlentities($_POST["nom"])); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1"; $sujet = addslashes(htmlentities($_POST["sujet"])); $message = array(addslashes(htmlentities($_POST["message"])), addslashes(htmlentities("\" a bien été envoyé à Christian MARQUAY.")), addslashes(htmlentities("Merci de ne pas répondre à ce courriel."))); $message1 = "<html><head><title>Message provenant du formulaire de www.christianmarquay.com</title></head>\n <body><p>" . $message[0] . "</p></body></html>"; $message2 = "<html><head><title>Confirmation d'envoi du message sur le formulaire du site www.christianmarquay.com</title></head>\n <body><p>Bonjour,</p><p>Le message : \"" . $message[0] . $message[1] . "</p><p>" . $message[2] . "</p></body></html>"; mail($email, "Confirmation d'envoi", $message2, $headers); $headers .= "\r\nFrom: " . $nom . " <" . $email . ">"; mail("*****@*****.**", $sujet, $message1, $headers); $affichage = "Votre message a bien été envoyé, vous allez recevoir une confirmation par email."; } else { $affichage = "Adresse email incorrecte !"; } } else { echo "<script type=\"text/javascript\">"; //traitement javascript echo "alert(\"Complétez tous les champs\");"; echo "window.history.back();"; echo "</script>";
<?php $titre = "Inscription"; include_once "connexion_base.php"; include_once "utile.php"; include_once "header.php"; $probleme = ""; //Traitement des variables POST if (isset($_POST["send"])) { if (isset($_POST["pseudo"]) && isset($_POST["email"]) && isset($_POST["nom"]) && isset($_POST["prenom"]) && isset($_POST["motDePasse"]) && !empty($_POST["pseudo"]) && !empty($_POST["email"]) && !empty($_POST["nom"]) && !empty($_POST["prenom"]) && !empty($_POST["motDePasse"])) { if (VerifierAdresseMail($_POST["email"])) { $pseudo = addslashes(htmlEntities($_POST["pseudo"])); $email = stripSlashes(htmlEntities($_POST["email"])); $nom = addslashes(htmlEntities($_POST["nom"])); $prenom = addslashes(htmlEntities($_POST["prenom"])); $motDePasse = md5(addslashes(htmlEntities($_POST["motDePasse"]))); $avatar = "images/avatars/defaut.jpg"; if (!DansBase($pseudo, $email)) { //On ajoute à la bdd l'utilisateur $sql1 = "INSERT INTO individu (`Pseudo`,`Email`,`Nom`,`Prenom`,`MotDePasse`"; $sql2 = ") VALUES('{$pseudo}','{$email}','{$nom}','{$prenom}','{$motDePasse}'"; if (isset($_FILES["avatar"]) && !empty($_FILES["avatar"])) { if ($_FILES["avatar"]["error"] == 0) { //copie dans le fichier avatars $avatar = "images/avatars/{$pseudo}.jpg"; $sql1 .= ",`Avatar`"; $sql2 .= ",'{$avatar}'"; move_uploaded_file($_FILES["avatar"]["tmp_name"], "{$avatar}"); } } $sql = $sql1 . $sql2 . ");";