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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
html {font-family: tahoma;}
label {
width:200px;
display:block;
float:left;
text-align: right;
padding-right:5px;
}
input, select { margin-bottom: 5px; }
input[type="text"] { width:300px; }
input[type="submit"] { height: 35px; width:100%; }
#cadre {
border : solid 1px black;
width: 720px;
}
h1 {
margin : 15px;
font-weight: normal;
}
</style>
</head>
<body>
<?php
$nom, $prenom, $surnom, $ddn, $vecu, $pere, $mere;
$DNS = 'mysql:host=localhost;dbname=genealogie';
$user = 'root';
$mdp = '';
try {
$bdd = new PDO( $DNS, $user, $mdp);
$requete = $bdd->prepare('INSERT INTO personne (nom, prenom, surnom, pere, mere, dateNaissance, vecu) VALUES ( ? , ? , ? , ?, ?, ?, ?) ');
} catch (Exception $e) {
echo e.getMessage();
}
?>
<div id="cadre">
<h1>Ajout d'une personne dans l'arbre généalogique </h1>
<form method="POST" action="ajouter.php">
<label> Nom de famille </label><input type="text" name = "nom"><br/>
<label> Prénom </label><input type="text" name = "prenom"><br/>
<label> Surnom </label><input type="text" name = "surnom"><br/>
<label> Père </label>
<select name="pere">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
<br/>
<label> Mère </label>
<select name="mere">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
<br/>
<label> Date de naissance </label><input type="date" name = "ddn"><br/>
<label> Lieu où a vécu la personne </label><input type="text" name = "vecu"><br/>
<input type="submit" value="Ajouter la personne">
</form>
</div>
</body>
</html> |
Partager