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
| <html>
<head></head>
<body>
<?php
// on se connecte à notre base
try
{
$bdd = new PDO('mysql:host=localhost;dbname=essaye', 'root', '');
}
catch (Exception $e)
{
die('Erreur : ' . $e->getMessage());
}
?>
<form method="post" action="etude.php" >
<input type="txt" name="nom"/>
<input type="date" name="datei"/>
<input type="txt" name="matricule"/>
<input type="submit" name="OK"/>
</form>
</body>
<?php>
$sql = 'INSERT INTO etudiant VALUES("'.$_POST['nom'].'", "'.$_POST['date'].'", "'.$_POST['matricule'].'")';
$execute_requet=mysql_query($sql);
?>
</html> |
Partager