I made this anti SQL Injection, I tested if I can still send queries, and it is looks good. could you tell me if you see any problem I missed, before I launch this to the internet? (this is contact us form, no log in)
<?php
if(isset($_POST['submit'])) {
$name = $_POST['username'];
$email = $_POST['email'];
$text = $_POST['textt'];
$connection = mysqli_connect('localhost', 'root', '', 'database1');
if($name && $email && $text ) {
echo "thanks you for contacting us, we will respond within 24 hours.";
}
else {
echo "Please enter name, email and your message.";
// echo $result;
}
$name = mysqli_real_escape_string($connection, $name);
$email = mysqli_real_escape_string($connection, $email);
$text = mysqli_real_escape_string($connection, $text);
$query = "INSERT INTO info(username,email,textt) ";
$query .= "VALUES ('$name', '$email', '$text')";
mysqli_query($connection, $query);
}
?>