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
| <?php
include 'connect.php';
$connexion = mysqli_connect($DB_HOST, $DB_USER, $DB_PASSWORD, $DB_NAME )or die ("erreur");
mysqli_query($connexion,"SET NAMES 'utf8'");
$nom = $_POST["nom"];
$prenom = $_POST["prenom"];
$adresse = $_POST["adresse"];
$code_postal = $_POST["code_postal"];
$ville = $_POST["ville"];
$degre = $_POST["degre"];
$email = $_POST["email"];
$telephone = $_POST["telephone"];
$naissance = $_POST["naissance"];
// je vérifie les variables...
echo $nom ;
echo $prenom ;
echo $adresse;
echo $code_postal;
echo $ville;
echo $email;
echo $degre;
echo $telephone;
echo $naissance;
// variables ok !
$query = "INSERT INTO $DB_TABLE_NAME (id, nom, prenom, adresse, code_postal, ville, degre, email, telephone, naissance) VALUES (NULL, '$nom', '$prenom', '$adresse', '$code_postal', '$ville', '$degre', '$email', '$telephone', '$naissance')";
mysqli_query($connexion, $query)or die ("erreur");
mysqli_close($connexion);
?> |
Partager