The problem is that the deletion is done only from the database and not from the server folder also. Is there an error with my code?
This deleteIMG.php
<?php
include('dbh.inc.php');
if (isset($_POST['submit4'])) {
//DELETE FILE
$del_img=$_GET['name'];
$queryy = "DELETE FROM table1 WHERE name='$del_img'";
$result = mysqli_query($conn, $queryy);
if ($result) {
?> <script> alert('This image has been deleted.'); window.location ="/pages/pictures.php"; </script>
<?php
unlink("/pages/uploads/$del_img");
} else {
?>
<script> alert('This image not yet deleted.'); window.location ="/pages/pictures.php"; </script>
<?php
}
}
?>