From 7c13b6478db952bbf810dd8f823d25b5ef74b882 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Wed, 10 Aug 2022 14:05:15 +0100 Subject: [PATCH] nothing ever works for me --- app/image/upload_image.php | 82 +++++++++++++++++++++++++++++++++++ assets/icons/bug.svg | 1 + image.php | 10 ++--- upload.php | 88 +++++++++++--------------------------- 4 files changed, 112 insertions(+), 69 deletions(-) create mode 100644 app/image/upload_image.php create mode 100644 assets/icons/bug.svg diff --git a/app/image/upload_image.php b/app/image/upload_image.php new file mode 100644 index 0000000..308e473 --- /dev/null +++ b/app/image/upload_image.php @@ -0,0 +1,82 @@ +resizeImage(300,null,null,1,null); + $image_thumbnail->writeImage($thumb_dir.$image_basename); + } catch (Exception $e) { + ?> + + + + + + + + + + \ No newline at end of file diff --git a/image.php b/image.php index 05fea59..7eb15e0 100644 --- a/image.php +++ b/image.php @@ -205,8 +205,6 @@

Danger zone

- - + + + resizeImage(300,null,null,1,null); - $image_thumbnail->writeImage($thumb_dir.$image_basename); - - // Prepare sql for destruction and filtering the sus - $sql = "INSERT INTO swag_table (imagename, alt, author) VALUES (?, ?, ?)"; - - if ($stmt = mysqli_prepare($conn, $sql)) { - // Bind the smelly smelly - mysqli_stmt_bind_param($stmt, "sss", $param_image_name, $param_alt_text, $param_user_id); - - // Setting up parameters - $param_image_name = $_FILES["image"]["name"]; - $param_alt_text = $_POST['alt']; - $param_user_id = $_SESSION["id"]; - - // Attempt to execute the prepared statement - if (mysqli_stmt_execute($stmt)) { - $success = "Your Image uploaded successfully!"; - } else { - $error = "Something went fuckywucky, please try later"; - } - } - } else { - $error = "F, Upload failed"; - } - } else { - $error = "File uploaded not supported, file types that are allowed include: JPG, JPEG, PNG and WEBP"; - } - } - } ?> -
- sniffleAdd('Error', '".$error."', 'var(--red)', '".$root_dir."assets/icons/cross.svg');"; - } - if (isset($success)) { - echo ""; - } - ?> - -
-

Upload image

In this world you have 2 choices, to upload a really cute picture of an animal or fursuit, or something other than those 2 things.

-
- - - + + + +