12345678910111213141516171819 |
- <?php
- // var_dump($_POST);
- if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- $hostname = "localhost";
- $username = "root";
- $password = "Bdtbdt17?";
- $port = "3306";
- $db = "intra";
- $dbconnect=mysqli_connect($hostname,$username,$password,$db,$port);
- $q = 'INSERT INTO client (name, type, localisation, departement) VALUES ("%s","%s","%s","%s")';
- $query = mysqli_query($dbconnect, sprintf($q,$_POST["name"],$_POST["type"],$_POST["localisation"],$_POST["departement"]))
- or die (mysqli_error($dbconnect));
- $dbconnect->close();
- header('Location: index.php');
- }
- ?>
|