robsstevejobs
-
Posts
30 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by robsstevejobs
-
-
ok, look at my code in html and PHP with the image of my database, it skips the line and it leaves empty box on the table.
HTML CODE
Form
<form id="news" action="insert.php" method="POST"> <label for="name">Nom</label> <input type="text" name="name" placeholder="votre nom"> <Br> <br> <label for="email">E-mail</label> <input type="email" name="email" placeholder="votre mail"> <br> <br> <input type="submit" name="button" value="newsletters"> </form>
PHP CODE
This is insert.php file
<?php $servername = "localhost"; $username = "root"; $password = "Robss123"; $dbname = "newsletter_database"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("connection failed:" .$conn->connect_error); } $name = mysqli_real_escape_string($conn, $_POST['name']); $email = mysqli_real_escape_string($conn, $_POST['email']); $sql = "INSERT INTO data_user_insert (name, email) VALUES ('$name','$email')"; if ($conn->query($sql) === TRUE) { echo "Votre enregistrement à reussi"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); if ($_SREVER["REQUEST_METHOD"] == "POST"){ $name = test_input($_POST["name"]); $email = test_input($_POST["email"]); } function test_input ($data){ $data = trim($data); $data = stripcslashes($data); $data = htmlspecialchars($data); return $data; } ?>
-
-
you can advise me which language, which I can manage easily.
-
hello to everyone, I wanted to know how I can receive the mail in a form create by bootstrap
Database
in General
Posted
hi, what solution do you offer me in this area, what is the code I can use to check and then eliminate empty space in the database.