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 31 32 33 34 35 36 37 38 39
|
<?php
session_start();
if (isset($_POST["modif"]))
{
header('Location: essaiform3listesUnIF.php' exit;
}
if (isset($_POST["conf"]))
{
// enregistrement des données de session en bdd
if (isset($_POST["conf"],$_SESSION['post_form']))
{
try
{
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host=localhost;dbname=clients', 'root', '', $pdo_options);
// Insertion du message à l'aide d'une requête préparée
$req = $bdd->prepare('INSERT INTO coordonnees (motdepasse, cat, selection, nom, prenom, numtel,ville,SiteWeb,MaPage,infos,horaire,Ouverture,adresse,mail) VALUES(?, ?, ?,?, ?, ?,?, ?, ?,?,?,?,?,?)');
$req->execute(array($_SESSION['post_form']['motdepasse'], $_SESSION['post_form']['cat'], $_SESSION['post_form']['selection'], $_SESSION['post_form']['nom'], $_SESSION['post_form']['prenom'], $_SESSION['post_form']['numtel'], $_SESSION['post_form']['ville'],$_SESSION['post_form']['SiteWeb'], $_SESSION['post_form']['MaPage'],$_SESSION['post_form']['infos'],$_SESSION['post_form']['horaire'],$_SESSION['post_form']['Ouverture'],$_SESSION['post_form']['adresse'],$_SESSION['post_form']['mail']));
unset($_SESSION['post_form']);
//redirection vers la page d'index
header('Location: Accueil.html');
exit;
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
}
}
//... (Ne pas oublier le "exit;" après un header Location)
?>[ |
Partager