File "slider-delete.php"
Full path: /home/fsibplc/public_html/sommilito-bank/admin/slider-delete.php
File
size: 339 B (339 B bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
require 'dbconfig.php';
$id = $_GET['id'];
// get image to delete file
$result = $conn->query("SELECT image FROM sliders WHERE id=$id");
$row = $result->fetch_assoc();
unlink("uploads/sliders/" . $row['image']); // delete file
$conn->query("DELETE FROM sliders WHERE id=$id");
header("Location: slider.php");
exit;