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 40 41 42 43 44 45 46 47 48 49 50 51 52
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Formulaire pour profils</title>
</head>
<?php
try
{
$bdd = new PDO('mysql:host=localhost;dbname=mes_contacts;charset=utf8', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$Prénom = htmlspecialchars($_POST['Prénom']);
echo '<p>'.$Prénom.'</p>';
$Nom = htmlspecialchars($_POST['Nom']);
echo '<p>'.$Nom.'</p>';
$Adresse = htmlspecialchars($_POST['Adresse']);
echo '<p>'.$Adresse.'</p>';
$Ville = htmlspecialchars($_POST['Ville']);
echo '<p>'.$Ville.'</p>';
$Code = htmlspecialchars($_POST['Code_postal']);
echo '<p>'.$Code.'</p>';
$Pays = htmlspecialchars($_POST['Pays']);
echo '<p>'.$Pays.'</p>';
$Tel = htmlspecialchars($_POST['Tel']);
echo '<p>'.$Tel.'</p>';
$Email = htmlspecialchars($_POST['Email']);
echo '<p>'.$Email.'</p>';
$Comp = htmlspecialchars($_POST['Compétences']);
echo '<p>'.$Comp.'</p>';
$req = $bdd->prepare('INSERT INTO profils(Prénom, Nom, Adresse, Code postal, Ville, Pays, Tel, Email, Compétences) VALUES(:Prénom, :Nom, :Adresse, :Code postal, :Ville, :Pays, :Tel, :Email, :Compétences)');
$req->execute(array(
'Prénom'=>$Prénom,
'Nom'=>$Nom,
'Adresse'=>$Adresse,
'Code postal'=>$Code,
'Ville'=>$Ville,
'Pays'=>$Pays,
'Tel' => $Tel,
'Email'=>$Email,
'Compétences'=>$Comp));
?>
</body>
</html> |
Partager