Clean up :3

This commit is contained in:
Michał 2022-07-23 08:44:43 +01:00
parent 697e41e913
commit acde68ac74
13 changed files with 85 additions and 79 deletions

View file

@ -1 +0,0 @@
<svg id="visual" viewBox="0 0 900 200" width="900" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><path d="M0 67L13.7 61.3C27.3 55.7 54.7 44.3 82 42.7C109.3 41 136.7 49 163.8 54.3C191 59.7 218 62.3 245.2 62.7C272.3 63 299.7 61 327 55.3C354.3 49.7 381.7 40.3 409 47.7C436.3 55 463.7 79 491 84C518.3 89 545.7 75 573 75C600.3 75 627.7 89 654.8 90.3C682 91.7 709 80.3 736.2 73.3C763.3 66.3 790.7 63.7 818 59C845.3 54.3 872.7 47.7 886.3 44.3L900 41L900 0L886.3 0C872.7 0 845.3 0 818 0C790.7 0 763.3 0 736.2 0C709 0 682 0 654.8 0C627.7 0 600.3 0 573 0C545.7 0 518.3 0 491 0C463.7 0 436.3 0 409 0C381.7 0 354.3 0 327 0C299.7 0 272.3 0 245.2 0C218 0 191 0 163.8 0C136.7 0 109.3 0 82 0C54.7 0 27.3 0 13.7 0L0 0Z" fill="#fa7268"></path><path d="M0 83L13.7 79.7C27.3 76.3 54.7 69.7 82 67.7C109.3 65.7 136.7 68.3 163.8 71.3C191 74.3 218 77.7 245.2 79C272.3 80.3 299.7 79.7 327 75.7C354.3 71.7 381.7 64.3 409 73.3C436.3 82.3 463.7 107.7 491 113.7C518.3 119.7 545.7 106.3 573 105C600.3 103.7 627.7 114.3 654.8 116.7C682 119 709 113 736.2 108.7C763.3 104.3 790.7 101.7 818 95.3C845.3 89 872.7 79 886.3 74L900 69L900 39L886.3 42.3C872.7 45.7 845.3 52.3 818 57C790.7 61.7 763.3 64.3 736.2 71.3C709 78.3 682 89.7 654.8 88.3C627.7 87 600.3 73 573 73C545.7 73 518.3 87 491 82C463.7 77 436.3 53 409 45.7C381.7 38.3 354.3 47.7 327 53.3C299.7 59 272.3 61 245.2 60.7C218 60.3 191 57.7 163.8 52.3C136.7 47 109.3 39 82 40.7C54.7 42.3 27.3 53.7 13.7 59.3L0 65Z" fill="#ef5f67"></path><path d="M0 121L13.7 122C27.3 123 54.7 125 82 128C109.3 131 136.7 135 163.8 133.3C191 131.7 218 124.3 245.2 126.3C272.3 128.3 299.7 139.7 327 146.7C354.3 153.7 381.7 156.3 409 158.7C436.3 161 463.7 163 491 159.3C518.3 155.7 545.7 146.3 573 143.7C600.3 141 627.7 145 654.8 144C682 143 709 137 736.2 134.7C763.3 132.3 790.7 133.7 818 137.3C845.3 141 872.7 147 886.3 150L900 153L900 67L886.3 72C872.7 77 845.3 87 818 93.3C790.7 99.7 763.3 102.3 736.2 106.7C709 111 682 117 654.8 114.7C627.7 112.3 600.3 101.7 573 103C545.7 104.3 518.3 117.7 491 111.7C463.7 105.7 436.3 80.3 409 71.3C381.7 62.3 354.3 69.7 327 73.7C299.7 77.7 272.3 78.3 245.2 77C218 75.7 191 72.3 163.8 69.3C136.7 66.3 109.3 63.7 82 65.7C54.7 67.7 27.3 74.3 13.7 77.7L0 81Z" fill="#e34c67"></path><path d="M0 173L13.7 172.3C27.3 171.7 54.7 170.3 82 173C109.3 175.7 136.7 182.3 163.8 181.3C191 180.3 218 171.7 245.2 169C272.3 166.3 299.7 169.7 327 172.3C354.3 175 381.7 177 409 178.3C436.3 179.7 463.7 180.3 491 177C518.3 173.7 545.7 166.3 573 167.7C600.3 169 627.7 179 654.8 181C682 183 709 177 736.2 176.7C763.3 176.3 790.7 181.7 818 181C845.3 180.3 872.7 173.7 886.3 170.3L900 167L900 151L886.3 148C872.7 145 845.3 139 818 135.3C790.7 131.7 763.3 130.3 736.2 132.7C709 135 682 141 654.8 142C627.7 143 600.3 139 573 141.7C545.7 144.3 518.3 153.7 491 157.3C463.7 161 436.3 159 409 156.7C381.7 154.3 354.3 151.7 327 144.7C299.7 137.7 272.3 126.3 245.2 124.3C218 122.3 191 129.7 163.8 131.3C136.7 133 109.3 129 82 126C54.7 123 27.3 121 13.7 120L0 119Z" fill="#d53867"></path><path d="M0 201L13.7 201C27.3 201 54.7 201 82 201C109.3 201 136.7 201 163.8 201C191 201 218 201 245.2 201C272.3 201 299.7 201 327 201C354.3 201 381.7 201 409 201C436.3 201 463.7 201 491 201C518.3 201 545.7 201 573 201C600.3 201 627.7 201 654.8 201C682 201 709 201 736.2 201C763.3 201 790.7 201 818 201C845.3 201 872.7 201 886.3 201L900 201L900 165L886.3 168.3C872.7 171.7 845.3 178.3 818 179C790.7 179.7 763.3 174.3 736.2 174.7C709 175 682 181 654.8 179C627.7 177 600.3 167 573 165.7C545.7 164.3 518.3 171.7 491 175C463.7 178.3 436.3 177.7 409 176.3C381.7 175 354.3 173 327 170.3C299.7 167.7 272.3 164.3 245.2 167C218 169.7 191 178.3 163.8 179.3C136.7 180.3 109.3 173.7 82 171C54.7 168.3 27.3 169.7 13.7 170.3L0 171Z" fill="#c62368"></path></svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 4.9 KiB

1
assets/bg2.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -1 +0,0 @@
<svg id="visual" viewBox="0 0 900 200" width="900" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><path d="M0 73L13.7 80C27.3 87 54.7 101 82 100.5C109.3 100 136.7 85 163.8 86C191 87 218 104 245.2 113C272.3 122 299.7 123 327 119.3C354.3 115.7 381.7 107.3 409 108.3C436.3 109.3 463.7 119.7 491 121.3C518.3 123 545.7 116 573 109.8C600.3 103.7 627.7 98.3 654.8 92C682 85.7 709 78.3 736.2 83.2C763.3 88 790.7 105 818 104.2C845.3 103.3 872.7 84.7 886.3 75.3L900 66L900 201L886.3 201C872.7 201 845.3 201 818 201C790.7 201 763.3 201 736.2 201C709 201 682 201 654.8 201C627.7 201 600.3 201 573 201C545.7 201 518.3 201 491 201C463.7 201 436.3 201 409 201C381.7 201 354.3 201 327 201C299.7 201 272.3 201 245.2 201C218 201 191 201 163.8 201C136.7 201 109.3 201 82 201C54.7 201 27.3 201 13.7 201L0 201Z" fill="#fa7268"></path><path d="M0 115L13.7 112.5C27.3 110 54.7 105 82 108.7C109.3 112.3 136.7 124.7 163.8 125C191 125.3 218 113.7 245.2 109.3C272.3 105 299.7 108 327 115C354.3 122 381.7 133 409 135.2C436.3 137.3 463.7 130.7 491 126C518.3 121.3 545.7 118.7 573 117C600.3 115.3 627.7 114.7 654.8 119.3C682 124 709 134 736.2 138.8C763.3 143.7 790.7 143.3 818 135.3C845.3 127.3 872.7 111.7 886.3 103.8L900 96L900 201L886.3 201C872.7 201 845.3 201 818 201C790.7 201 763.3 201 736.2 201C709 201 682 201 654.8 201C627.7 201 600.3 201 573 201C545.7 201 518.3 201 491 201C463.7 201 436.3 201 409 201C381.7 201 354.3 201 327 201C299.7 201 272.3 201 245.2 201C218 201 191 201 163.8 201C136.7 201 109.3 201 82 201C54.7 201 27.3 201 13.7 201L0 201Z" fill="#ef5f67"></path><path d="M0 149L13.7 143.7C27.3 138.3 54.7 127.7 82 129.5C109.3 131.3 136.7 145.7 163.8 145.2C191 144.7 218 129.3 245.2 122.8C272.3 116.3 299.7 118.7 327 123.8C354.3 129 381.7 137 409 139.2C436.3 141.3 463.7 137.7 491 131.8C518.3 126 545.7 118 573 115.3C600.3 112.7 627.7 115.3 654.8 122.5C682 129.7 709 141.3 736.2 143.8C763.3 146.3 790.7 139.7 818 134.2C845.3 128.7 872.7 124.3 886.3 122.2L900 120L900 201L886.3 201C872.7 201 845.3 201 818 201C790.7 201 763.3 201 736.2 201C709 201 682 201 654.8 201C627.7 201 600.3 201 573 201C545.7 201 518.3 201 491 201C463.7 201 436.3 201 409 201C381.7 201 354.3 201 327 201C299.7 201 272.3 201 245.2 201C218 201 191 201 163.8 201C136.7 201 109.3 201 82 201C54.7 201 27.3 201 13.7 201L0 201Z" fill="#e34c67"></path><path d="M0 161L13.7 160.2C27.3 159.3 54.7 157.7 82 153.8C109.3 150 136.7 144 163.8 140.3C191 136.7 218 135.3 245.2 140.2C272.3 145 299.7 156 327 160.3C354.3 164.7 381.7 162.3 409 160.3C436.3 158.3 463.7 156.7 491 157.7C518.3 158.7 545.7 162.3 573 160.5C600.3 158.7 627.7 151.3 654.8 147C682 142.7 709 141.3 736.2 140.2C763.3 139 790.7 138 818 138.7C845.3 139.3 872.7 141.7 886.3 142.8L900 144L900 201L886.3 201C872.7 201 845.3 201 818 201C790.7 201 763.3 201 736.2 201C709 201 682 201 654.8 201C627.7 201 600.3 201 573 201C545.7 201 518.3 201 491 201C463.7 201 436.3 201 409 201C381.7 201 354.3 201 327 201C299.7 201 272.3 201 245.2 201C218 201 191 201 163.8 201C136.7 201 109.3 201 82 201C54.7 201 27.3 201 13.7 201L0 201Z" fill="#d53867"></path><path d="M0 168L13.7 170.5C27.3 173 54.7 178 82 177.3C109.3 176.7 136.7 170.3 163.8 170.5C191 170.7 218 177.3 245.2 178.2C272.3 179 299.7 174 327 170.3C354.3 166.7 381.7 164.3 409 163.5C436.3 162.7 463.7 163.3 491 165.3C518.3 167.3 545.7 170.7 573 171.2C600.3 171.7 627.7 169.3 654.8 170C682 170.7 709 174.3 736.2 177.3C763.3 180.3 790.7 182.7 818 181.8C845.3 181 872.7 177 886.3 175L900 173L900 201L886.3 201C872.7 201 845.3 201 818 201C790.7 201 763.3 201 736.2 201C709 201 682 201 654.8 201C627.7 201 600.3 201 573 201C545.7 201 518.3 201 491 201C463.7 201 436.3 201 409 201C381.7 201 354.3 201 327 201C299.7 201 272.3 201 245.2 201C218 201 191 201 163.8 201C136.7 201 109.3 201 82 201C54.7 201 27.3 201 13.7 201L0 201Z" fill="#c62368"></path></svg>

Before

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -1 +0,0 @@
<svg id="visual" viewBox="0 0 900 200" width="900" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><path d="M0 93L13.7 100C27.3 107 54.7 121 82 127C109.3 133 136.7 131 163.8 125C191 119 218 109 245.2 107.7C272.3 106.3 299.7 113.7 327 119.2C354.3 124.7 381.7 128.3 409 122.7C436.3 117 463.7 102 491 96.3C518.3 90.7 545.7 94.3 573 100.2C600.3 106 627.7 114 654.8 118C682 122 709 122 736.2 117.2C763.3 112.3 790.7 102.7 818 93.5C845.3 84.3 872.7 75.7 886.3 71.3L900 67L900 0L886.3 0C872.7 0 845.3 0 818 0C790.7 0 763.3 0 736.2 0C709 0 682 0 654.8 0C627.7 0 600.3 0 573 0C545.7 0 518.3 0 491 0C463.7 0 436.3 0 409 0C381.7 0 354.3 0 327 0C299.7 0 272.3 0 245.2 0C218 0 191 0 163.8 0C136.7 0 109.3 0 82 0C54.7 0 27.3 0 13.7 0L0 0Z" fill="#fa7268"></path><path d="M0 107L13.7 101.2C27.3 95.3 54.7 83.7 82 74.7C109.3 65.7 136.7 59.3 163.8 56.3C191 53.3 218 53.7 245.2 61.7C272.3 69.7 299.7 85.3 327 86.7C354.3 88 381.7 75 409 75.7C436.3 76.3 463.7 90.7 491 89.7C518.3 88.7 545.7 72.3 573 66.2C600.3 60 627.7 64 654.8 71.5C682 79 709 90 736.2 96.7C763.3 103.3 790.7 105.7 818 105.7C845.3 105.7 872.7 103.3 886.3 102.2L900 101L900 0L886.3 0C872.7 0 845.3 0 818 0C790.7 0 763.3 0 736.2 0C709 0 682 0 654.8 0C627.7 0 600.3 0 573 0C545.7 0 518.3 0 491 0C463.7 0 436.3 0 409 0C381.7 0 354.3 0 327 0C299.7 0 272.3 0 245.2 0C218 0 191 0 163.8 0C136.7 0 109.3 0 82 0C54.7 0 27.3 0 13.7 0L0 0Z" fill="#ef5f67"></path><path d="M0 70L13.7 67.2C27.3 64.3 54.7 58.7 82 57.3C109.3 56 136.7 59 163.8 58.8C191 58.7 218 55.3 245.2 53.2C272.3 51 299.7 50 327 54.5C354.3 59 381.7 69 409 70.8C436.3 72.7 463.7 66.3 491 65.8C518.3 65.3 545.7 70.7 573 72.5C600.3 74.3 627.7 72.7 654.8 72.3C682 72 709 73 736.2 74.8C763.3 76.7 790.7 79.3 818 81.7C845.3 84 872.7 86 886.3 87L900 88L900 0L886.3 0C872.7 0 845.3 0 818 0C790.7 0 763.3 0 736.2 0C709 0 682 0 654.8 0C627.7 0 600.3 0 573 0C545.7 0 518.3 0 491 0C463.7 0 436.3 0 409 0C381.7 0 354.3 0 327 0C299.7 0 272.3 0 245.2 0C218 0 191 0 163.8 0C136.7 0 109.3 0 82 0C54.7 0 27.3 0 13.7 0L0 0Z" fill="#e34c67"></path><path d="M0 47L13.7 48.7C27.3 50.3 54.7 53.7 82 55.5C109.3 57.3 136.7 57.7 163.8 53.7C191 49.7 218 41.3 245.2 40.7C272.3 40 299.7 47 327 45.5C354.3 44 381.7 34 409 33.7C436.3 33.3 463.7 42.7 491 45.3C518.3 48 545.7 44 573 43.5C600.3 43 627.7 46 654.8 44.3C682 42.7 709 36.3 736.2 38.2C763.3 40 790.7 50 818 51.5C845.3 53 872.7 46 886.3 42.5L900 39L900 0L886.3 0C872.7 0 845.3 0 818 0C790.7 0 763.3 0 736.2 0C709 0 682 0 654.8 0C627.7 0 600.3 0 573 0C545.7 0 518.3 0 491 0C463.7 0 436.3 0 409 0C381.7 0 354.3 0 327 0C299.7 0 272.3 0 245.2 0C218 0 191 0 163.8 0C136.7 0 109.3 0 82 0C54.7 0 27.3 0 13.7 0L0 0Z" fill="#d53867"></path><path d="M0 13L13.7 14C27.3 15 54.7 17 82 17.2C109.3 17.3 136.7 15.7 163.8 17.8C191 20 218 26 245.2 28C272.3 30 299.7 28 327 25.7C354.3 23.3 381.7 20.7 409 19.2C436.3 17.7 463.7 17.3 491 21.3C518.3 25.3 545.7 33.7 573 33.2C600.3 32.7 627.7 23.3 654.8 23.2C682 23 709 32 736.2 36.3C763.3 40.7 790.7 40.3 818 39.5C845.3 38.7 872.7 37.3 886.3 36.7L900 36L900 0L886.3 0C872.7 0 845.3 0 818 0C790.7 0 763.3 0 736.2 0C709 0 682 0 654.8 0C627.7 0 600.3 0 573 0C545.7 0 518.3 0 491 0C463.7 0 436.3 0 409 0C381.7 0 354.3 0 327 0C299.7 0 272.3 0 245.2 0C218 0 191 0 163.8 0C136.7 0 109.3 0 82 0C54.7 0 27.3 0 13.7 0L0 0Z" fill="#c62368"></path></svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -22,7 +22,7 @@
max-width: 300px; height: 200px;
background-color: var(--gray);
background-color: var(--bg-2);
border-radius: var(--rad);
flex: 1 0 150px;

View file

@ -14,6 +14,7 @@
--fg-dark: #151515;
--red: #B66467;
--orange: #FF7700;
--green: #8C977D;
--black: #151515;
--white: #E8E3E3;
@ -29,16 +30,20 @@
html {
margin: 0; padding: 0;
height: 100vh; width: 100vw;
min-height: 100vh; max-width: 100vw;
background-color: var(--bg-2);
background-image: url("../assets/bg2.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
body {
margin: 0 auto; padding: 1rem;
min-height: calc(100vh - 1rem);
max-width: 1500px;
min-height: calc(100vh - 2rem); max-width: 1500px;
display: flex;
flex-direction: column;
@ -70,13 +75,17 @@ body {
}
.alert {
margin: 0; padding: 1rem;
margin: 0 auto; padding: 1rem;
width: inherit;
text-align: center;
display: inline-block;
border-radius: var(--rad);
outline: 0.5rem solid var(--bg);
}
.alert-high {
background-color: var(--green);

View file

@ -16,3 +16,10 @@ nav {
border-radius: var(--rad);
box-shadow: var(--shadow);
}
nav h3 {
margin: 0;
}
nav hr {
margin: 0.5rem 0.2rem; padding: 0;
}

View file

@ -8,49 +8,44 @@
<link href="https://fonts.googleapis.com/css2?family=Rubik" rel="stylesheet">
</head>
<body>
<?php include('ui/header.php'); ?>
<?php
// Attempt database connection
$conn = mysqli_connect("localhost", "uwu", "password", "swag");
// If connecton failed, notify user
if (!$conn) {
echo "<p class='alert fail'>Could not connect to database</p>";
include("ui/header.php");
include_once("ui/conn.php");
// 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);
if (!isset($_GET['id'])) {
echo "<p class='alert alert-low'>No ID present</p>";
$image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy";
} elseif (empty($image['imagename'])) {
echo "<p class='alert alert-low'>Could not find image with ID: ".$_GET['id']."</p>";
$image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy";
} else {
$image_path = "images/".$image['imagename'];
$image_alt = $image['alt'];
}
?>
<div class="image-container">
<?php
// 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);
if ($image['imagename'] != "") {
$image_path = "images/".$image['imagename'];
$image_alt = $image['alt'];
}else{
$image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy";
}
echo "<img class='image' id='".$image['id']."' src='".$image_path."' alt='".$image_alt."'>";
if (!isset($_GET['id'])) {
echo "cannot obtain image";
}
?>
<?php echo "<img class='image' id='".$image['id']."' src='".$image_path."' alt='".$image_alt."'>"; ?>
</div>
<div class="image-description">
<h2>Description</h2>
<?php
// Image Description/Alt
if ($image_alt != "") {
echo "<p>".$image_alt."</p>";
}else{
if (empty($image_alt)) {
echo "<p>Image uploaded prior to description being added</p>";
}else{
echo "<p>".$image_alt."</p>";
}
?>
@ -93,7 +88,7 @@
// Deleted image
header("Location:index.php?del=true&id=".$image['id']);
}
}else{
} else {
// Could not delete from file
echo "<p class='alert alert-fail' id='deleted'>Error: Coult not delete image</p>";
}
@ -101,6 +96,6 @@
?>
</div>
<?php include('ui/footer.php'); ?>
<?php include("ui/footer.php"); ?>
</body>
</html>

View file

@ -10,7 +10,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@500&amp;display=swap">
</head>
<body>
<?php include('ui/header.php'); ?>
<?php include("ui/header.php"); ?>
<?php
if ($_GET["del"] == "true") {
@ -24,12 +24,7 @@
</div>
<?php
// Attempt database connection
$conn = mysqli_connect("localhost", "uwu", "password", "swag");
// If connecton failed, notify user
if (!$conn) {
echo "<p class='alert alert-high'>Could not connect to database</p>";
}
include_once("ui/conn.php");
// My terrible workaround for not being able to show deletion status up here
@ -45,7 +40,7 @@
// Getting thumbnail
if (file_exists("images/thumbnails/".$row['imagename'])) {
$image_path = "images/thumbnails/".$row['imagename'];
}else{
} else {
$image_path = "images/".$row['imagename'];
}
@ -57,6 +52,6 @@
?>
</div>
<?php include('ui/footer.php'); ?>
<?php include("ui/footer.php"); ?>
</body>
</html>

8
ui/conn.php Normal file
View file

@ -0,0 +1,8 @@
<?php
// Attempt database connection
$conn = mysqli_connect("localhost", "uwu", "password", "swag");
// If connecton failed, notify user
if (!$conn) {
echo "<p class='alert alert-low'>Could not connect to database</p>";
}
?>

View file

@ -5,12 +5,12 @@
<p>Twitter</p>
<p>Discord</p>
</div>
<div class="footer-child center flex-down">
<!--<div class="footer-child center flex-down">
<h3>Information</h3>
<p>How to use</p>
<p>Wiki</p>
<p>Guides</p>
</div>
</div>-->
<div class="footer-child center flex-down">
<h3>Other</h3>
<p>AAAAAAAA</p>

View file

@ -8,36 +8,34 @@
<link href="https://fonts.googleapis.com/css2?family=Rubik" rel="stylesheet">
</head>
<body>
<?php include('ui/header.php'); ?>
<?php include("ui/header.php"); ?>
<div class="upload-root">
<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">
<span class="space-bottom"></span>
<br class="space-bottom">
<input class="btn alert-default" type="text" name="alt" placeholder="Description/Alt for image">
<span class="space-bottom"></span>
<br class="space-bottom">
<button class="btn alert-default" type="submit" name="upload">Upload Image</button>
</form>
<?php
if ($_GET["r"] == "success") {
// Image uploaded
echo "<p class='alert alert-high space-top'>Your Image uploaded successfully!</p>";
}elseif ($_GET["r"] == "fail") {
} elseif ($_GET["r"] == "fail") {
// Upload failed
echo "<p class='alert alert-low space-top'>F, Upload failed</p>";
}elseif ($_GET["r"] == "nofile") {
} elseif ($_GET["r"] == "nofile") {
// No file was present
echo "<p class='alert alert-default space-top'>No file lol</p>";
}else{
} else {
// echo "<p class='alert alert-default'>Select an image to upload</p>";
}
?>
</div>
<?php
// Attempt database connection
$conn = mysqli_connect("localhost", "uwu", "password", "swag");
// If connecton failed, notify user
if (!$conn) {
echo "<p class='alert fail'>Could not connect to database</p>";
}
include_once("ui/conn.php");
if (isset($_POST['upload'])) {
@ -45,15 +43,15 @@
$get_image_name = $_FILES['image']['name'];
// Get alt text
if ($_POST['alt'] != "") {
$get_alt_text = $_POST['alt'];
}else{
if (empty($_POST['alt'])) {
$get_alt_text = "No description provided";
} else {
$get_alt_text = $_POST['alt'];
}
// If image present, continue
if ($get_image_name != "") {
if (!empty($get_image_name)) {
// Set file path for image upload
$image_basename = basename($get_image_name);
$image_path = "images/".$image_basename;
@ -74,21 +72,23 @@
if ($image_format == 'GIF') {
$image_thumbnail = $image_thumbnail->coalesceImages();
}
// Resize image
$image_thumbnail->resizeImage(300,null,null,1,null);
// Save image
$image_thumbnail->writeImage("images/thumbnails/".$image_basename);
header("Location:upload.php?r=success");
}else{
} else {
// Could not move images to folder
header("Location:upload.php?r=fail");
}
}else{
} else {
// No image present
header("Location:upload.php?r=nofile");
}
}
?>
<?php include('ui/footer.php'); ?>
<?php include("ui/footer.php"); ?>
</body>
</html>