I'm trying to add a php button on to my site, however it doesn't seem to be working.
The delete php script is;
if(isset($_POST["delete"])) {
$delquery = "DELETE FROM emails WHERE ID=$_POST["delete"]";
mysqli_query($connection, $delquery);
}
And the form looks like which is on the same file;
<form action="email-response.php" method="post">
<input type="hidden" name="hidden" value="<?php echo $row['ID']; ?>">
<input type="submit" name="delete" value="delete">
</form>
However whenever I clicked the delete button nothing is happening.
In relation to the reply saying that my $connection function is wrong, here is the function however its working as it is fetching my information for my posts.
define("DB_SERVER", "myservername");
define("DB_USER", "myusername"); //username
define("DB_PASS", "mypassword"); //password
define("DB_NAME", "mydbname"); // database name
$connection = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
if(mysqli_connect_errno()) {
die("Database connection failed: " .
mysqli_connect_error() .
" (" . mysqli_connect_errno() . ")"
);
} else {
echo "connected";
}