0byt3m1n1
Path:
/
var
/
www
/
listcrawler.app
/
public_html
/
admin
/
[
Home
]
File: delete_sponsor_photo.php
<?php session_start(); require_once 'includes/auth_validate.php'; require_once './config/config.php'; $del_id = filter_input(INPUT_POST, 'del_id'); $list_id = filter_input(INPUT_POST, 'list_id'); if ($del_id && $_SERVER['REQUEST_METHOD'] == 'POST') { if($_SESSION['admin_type']!='super'){ $_SESSION['failure'] = "You don't have permission to perform this action"; header('location: sponsors.php'); exit; } $photo_id = $del_id; $db = getDbInstance(); $db->where('id', $photo_id); $data_pic = $db->getOne('sponsor_photos'); @unlink("../sponsor_pics/" . $data_pic['photo_name']); $db->where('id', $photo_id); $status = $db->delete('sponsor_photos'); if ($status) { $_SESSION['info'] = "Pic deleted successfully!"; // Redirect to the edit page header('Location: edit_sponsor.php?sponsor_id=' . $list_id . '&operation=edit'); // Important! Don't execute the rest put the exit/die. exit(); } else { $_SESSION['failure'] = "Unable to delete Pic"; header('location: sponsors.php'); exit; } }