Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <?php
- $servername = "db611719487.db.1and1.com";
- $username = "dbo611719487";
- $password = "descartes16!";
- $dbname = "db611719487";
- $mysqli= new mysqli($servername, $username, $password,$dbname);
- /*Vérification de la connexion*/
- if($mysqli->connect_errno){
- printf("Echec de la connexion: %s\n", $conn->connect_errno);
- exit();
- }
- //Vérification si nom et prenom existent
- $nom=$_POST['nom'];
- $prenom=$_POST['prenom'];
- if((isset($nom)) && (!empty($nom))&& (isset($prenom))&& (!empty($prenom))){
- $sql = "INSERT INTO fnp_users(nom,prenom)VALUES ('$nom','$prenom')";
- exit($sql);
- mysqli_query($mysqli,$sql);
- }
- else
- die("creve");
- if ($mysqli->query($sql)===TRUE) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . $mysqli->error;
- }
- $mysqli->close();
- // <table>
- // <tr>
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement