1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
<?php
if(!empty($_POST['nom']) AND !empty($_POST['age'])) {
//connection à la bdd
$connect = mysql_connect($host,$user,$passwd);
mysql_select_db($bdd, $connect) ;
$sql = "INSERT INTO table (champs_nom, champs_age) VALUES ($_POST['nom'], $_POST['age'])";
//tu rempli ta table
mysql_query($sql, $connect);
mysq_close($connect);
}
?>
<html>
<form action="" method="post">
Entrez votre nom : <input type="text" name="nom" />
Entrez votre age : <input type="text" name="age" />
<input type="submit" value="envoyer" />
</form>
</html> |
Partager