In your Direct link, you are missing single inverted quote:
echo "<td>" . "<a href='delete.php?del=$row[id]'>Delete</a>" . "</td>";
^ -here
It should be like:
echo "<td>" . "<a href='delete.php?del=$row['id']'>Delete</a>" . "</td>";
Also, in your delete.php, you are getting the value via POST, while you are passing id as GET, So make it:
// $con or similar is the variable in your connect.php
include("connect.php");
if( isset($_GET['del']))
{
$id = mysqli_real_escape_string($con, $_GET['del']);
$sql = "DELETE FROM `termekek` WHERE id = $id" ;
echo "<a href='admin.php'>Back</a>";
}
Now, you need to run the query also.
So this will work:
// $con or similar is the variable in your connect.php
include("connect.php");
if( isset($_GET['del']))
{
$id = mysqli_real_escape_string($con, $_GET['id']);
$sql = "DELETE FROM `termekek` WHERE id = $id" ;
mysqli_query($con, $sql);
echo "<a href='admin.php'>Back</a>";
}
Also, a small note (sounds obvious): Do not pass id or sensible data with GET
method. Anybody can pass the id by merely changing the variable del
from url to other id and that thing will be bad.