Information updated

"; } // Get image ID // Getting all image info from table $get_image = "SELECT * FROM swag_table WHERE id = ".$_GET['id']; $image_results = mysqli_query($conn, $get_image); $image = mysqli_fetch_assoc($image_results); // Check if ID of image in URL if (!isset($_GET['id'])) { // No ID toast echo "

No ID present

"; // Replacement "no image" image and description $image_path = "assets/no_image.png"; $image_alt = "No image could be found, sowwy"; } elseif (empty($image['imagename'])) { // ID not avalible toast echo "

Could not find image with ID: ".$_GET['id']."

"; // Replacement "no image" image and description $image_path = "assets/no_image.png"; $image_alt = "No image could be found, sowwy"; } else { // Display image $image_path = "images/".$image['imagename']; $image_alt = $image['alt']; } ?>
"; ?>

Description

No description provided

"; }else{ echo "

".$image_alt."

"; } ?>

Details

ID: ".$image['id']."

"; // File name echo "

File Name: ".$image['imagename']."

"; // Image Upload date echo "

Upload Date: ".$image['upload']."

"; // Image resolution list($width, $height) = getimagesize($image_path); echo "

Image resolution: ".$width."x".$height."

"; // Image download echo "Download image"; ?>

Danger zone

"; echo ""; echo ""; // Check if query is set if (isset($_POST['delete'])) { // Try deleting image if(unlink("images/".$image['imagename']) && unlink("images/thumbnails/".$image['imagename'])) { // If deleted, delete from Table $image_delete_request = "DELETE FROM swag_table WHERE id =".$image['id']; $image_delete = mysqli_query($conn,$image_delete_request); if ($image_delete) { // Deleted image header("Location:index.php?del=true&id=".$image['id']); } } else { // Could not delete from file echo "

Error: Coult not delete image

"; } } ?> Modify image content"; ?>