Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>donnees</title>
- </head>
- <body>
- <h2>inventaire</h2>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "inscription";
- // Create connection
- $link = new mysqli($servername, $username, $password, $dbname);
- $nom=$link->real_escape_string($_POST["Nom"]);
- $prenom=$link->real_escape_string($_POST["Prenom"]);
- $email=$link->real_escape_string($_POST["Email"]);
- $adresse_postale=$link->real_escape_string($_POST["Adresse_postale"]);
- $cours_de_francais=$link->real_escape_string($_POST["Cours_de_francais"]);
- $cours_de_maths=$link->real_escape_string($_POST["Cours_de_maths"]);
- $cours_scientifiques=$link->real_escape_string($_POST["Cours_scientifiques"]);
- $commentaires=$link->real_escape_string($_POST["Commentaires"]);
- // Check connection
- if ($link->connect_error) {
- die("Connection failed: " . $link->connect_error);
- }
- $sql = "INSERT INTO utilisateur (ID, Nom, Prenom, Email, Adresse_postale, Cours_de_francais, Cours_de_maths, Cours_scientifiques, Commentaires)
- VALUES (null, '".$nom."', '".$prenom."', '".$email."', '".$adresse_postale."', '".$cours_de_francais."', '".$cours_de_maths."', '".$cours_scientifiques."', '".$commentaires."')";
- if ($link->query($sql) === TRUE) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . $link->error;
- }
- $link->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement