Hi, i’ve got a database and a few pages using it.
My problem is that when i navigate to the page that inserts the rows, it adds empty rows because the form on the previous page was empty, how do i prevent this.
One other question is how do i improve security on the pages using php.
Here is my code
[php]<?php
$con=mysqli_connect("************************");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_real_escape_string();
$emailad = $_POST[‘Text box’];
$query = “INSERT INTO emails (emailad) VALUES (’{$emailad}’)”;
mysqli_query($con, $query);
mysqli_close($con);
header( 'Location: ‘***************’ ) ;
?>[/php]