diff --git a/assets/no_image.png b/assets/no_image.png new file mode 100644 index 0000000..8f7cc08 Binary files /dev/null and b/assets/no_image.png differ diff --git a/css/master.css b/css/master.css index 4e843d8..3491940 100644 --- a/css/master.css +++ b/css/master.css @@ -179,7 +179,7 @@ form { background-color: var(--gray); border-radius: var(--rad); - flex: 1 0 150px; + flex: 1 0 170px; transition: transform 0.15s cubic-bezier(.19,1,.22,1); } @@ -194,7 +194,7 @@ form { } .gallery-item:hover { - transform: scale(1.1); + transform: scale(1.1) rotate(5deg); box-shadow:0 0 5px var(--dark-gray); } diff --git a/image.php b/image.php index a8a79b2..b904c7a 100644 --- a/image.php +++ b/image.php @@ -27,7 +27,15 @@ $image_results = mysqli_query($conn, $get_image); $image = mysqli_fetch_assoc($image_results); - echo ""; + if ($image['imagename'] != "") { + $image_name = "images/".$image['imagename']; + $image_alt = $image['alt']; + }else{ + $image_name = "assets/no_image.png"; + $image_alt = "No image could be found, sowwy"; + } + + echo "".$image_alt.""; if (!isset($_GET['id'])) { echo "cannot obtain image"; @@ -40,7 +48,7 @@ echo "

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

"; echo "

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

"; echo "

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

"; - echo "

Description: ".$image['alt']."

"; + echo "

Description: ".$image_alt."

"; ?> diff --git a/upload.php b/upload.php index 2cf5597..c850798 100644 --- a/upload.php +++ b/upload.php @@ -14,7 +14,7 @@

- +

@@ -27,7 +27,7 @@ }elseif ($_GET["r"] == "nofile") { echo "

No file lol

"; }else{ - echo "

Select an image to upload

"; + // echo "

Select an image to upload

"; } ?> @@ -67,10 +67,8 @@ // Checking if image uploaded if (move_uploaded_file($_FILES['image']['tmp_name'], $image_path)) { header("Location:upload.php?r=success"); - }else{ header("Location:upload.php?r=fail"); - } }else{ // No image present