diff --git a/image.php b/image.php index 2b0e9cf..578f3ae 100644 --- a/image.php +++ b/image.php @@ -28,14 +28,14 @@ $image = mysqli_fetch_assoc($image_results); if ($image['imagename'] != "") { - $image_name = "images/".$image['imagename']; + $image_path = "images/".$image['imagename']; $image_alt = $image['alt']; }else{ - $image_name = "assets/no_image.png"; + $image_path = "assets/no_image.png"; $image_alt = "No image could be found, sowwy"; } - echo "".$image_alt.""; + echo "".$image_alt.""; if (!isset($_GET['id'])) { echo "cannot obtain image"; @@ -46,16 +46,31 @@

Description

".$image_alt."

"; + // Image Description/Alt + if ($image_alt != "") { + echo "

".$image_alt."

"; + }else{ + echo "

Image uploaded prior to description being added

"; + } + ?>

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."

"; ?>
diff --git a/index.php b/index.php index 742931b..70a3e39 100644 --- a/index.php +++ b/index.php @@ -42,9 +42,16 @@ // Reading images from table $img = mysqli_query($conn, "SELECT * FROM swag_table"); while ($row = mysqli_fetch_array($img)) { - echo "