mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2024-12-28 02:16:17 +00:00
I have no clue what I added here
This commit is contained in:
parent
674a25dcba
commit
310510b686
BIN
assets/no_image.png
Normal file
BIN
assets/no_image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
12
image.php
12
image.php
|
@ -27,7 +27,15 @@
|
|||
$image_results = mysqli_query($conn, $get_image);
|
||||
$image = mysqli_fetch_assoc($image_results);
|
||||
|
||||
echo "<img class='image' src='images/".$image['imagename']."' id='".$image['id']."'>";
|
||||
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 "<img class='image' id='".$image['id']."' src='".$image_name."' alt='".$image_alt."'>";
|
||||
|
||||
if (!isset($_GET['id'])) {
|
||||
echo "cannot obtain image";
|
||||
|
@ -40,7 +48,7 @@
|
|||
echo "<p>ID: ".$image['id']."</p>";
|
||||
echo "<p>File Name: ".$image['imagename']."</p>";
|
||||
echo "<p>Upload Date: ".$image['upload']."</p>";
|
||||
echo "<p>Description: ".$image['alt']."</p>";
|
||||
echo "<p>Description: ".$image_alt."</p>";
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<form class="flex-down between" method="POST" action="upload.php" enctype="multipart/form-data">
|
||||
<input class="btn alert-default" type="file" name="image" placeholder="select image UwU">
|
||||
<hr class="space-small">
|
||||
<input class="btn" type="text" name="alt" placeholder="Enter a description for image, this will also be used as an alt">
|
||||
<input class="btn" type="text" name="alt" placeholder="Description/Alt for image">
|
||||
<hr class="space-small">
|
||||
<button class="btn alert-default" type="submit" name="upload">Upload Image</button>
|
||||
<hr class="space-small">
|
||||
|
@ -27,7 +27,7 @@
|
|||
}elseif ($_GET["r"] == "nofile") {
|
||||
echo "<p class='alert alert-default'>No file lol</p>";
|
||||
}else{
|
||||
echo "<p class='alert alert-default'>Select an image to upload</p>";
|
||||
// echo "<p class='alert alert-default'>Select an image to upload</p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue