View file File name : comment.php Content :<?php include '../../db.php'; $image = $_GET['img']; $file1 = '../../images/comments/' . $image; unlink($file1); $sql = "DELETE FROM `comments` WHERE `image_name` = '$image'"; $db = new DB(); if ($db->readQuery($sql)) { header('Location: ' . $_SERVER['HTTP_REFERER']); }