1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| if (isset($_POST['modif_profil'])) {
$erreur = checkForm();
// pas d'erreur
if (empty($erreur)) {
//Protection par captcha
//if($_POST['captcha'] == $_SESSION['captcha']){
$req = Cnx::connectCnx()->prepare("UPDATE users SET societe=:societe, nom=:nom, prenom=:prenom, adresse=:adresse, cp=:cp, ville=:ville, tel1=:tel1, tel2=:tel2, mail=:mail, niveau=:niveau WHERE id=:id");
$req->bindValue(':societe', $_POST['societe']);
$req->bindParam(':nom', $_POST['nom']);
$req->bindParam(':prenom', $_POST['prenom']);
$req->bindParam(':adresse', $_POST['adresse']);
$req->bindParam(':cp', $_POST['cp'], PDO::PARAM_INT);
$req->bindParam(':ville', $_POST['ville']);
$req->bindParam(':tel1', $_POST['tel1']);
$req->bindValue(':tel2', $_POST['tel2']);
$req->bindParam(':mail', $_POST['mail']);
$req->bindParam(':niveau', $_POST['niveau']);
$req->bindParam(':id', $_POST['id'], PDO::PARAM_INT);
$req->execute();
/*}else{echo "Veuillez calculer le code de sécurité";}*/
} else {
echo '<div class="error">';
foreach ($erreur as $e) {
echo $e, '<br />';
}
echo '</div>';
}
} |
Partager