D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
delete_image.php
back
Copy
<?php include "../config.php"; ?> <?php // Include your database configuration // Check if the "id" parameter is set in the URL if (isset($_GET['id']) && is_numeric($_GET['id'])) { $imageId = $_GET['id']; // Add code to delete the image with the given ID from the database $sqlDelete = "DELETE FROM pictures WHERE id = $imageId"; if ($conn->query($sqlDelete) === TRUE) { // Deletion was successful header("Location: view_ashaar.php"); // Redirect back to your page exit; } else { // Deletion failed, you can handle errors or display an error message echo "Error deleting record: " . $conn->error; } } // Close the database connection $conn->close(); ?>