mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-29 14:53:12 +00:00
Fixing directory and required file issues
This commit is contained in:
parent
9ed36e2738
commit
1472692ed5
16 changed files with 51 additions and 119 deletions
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Initialize the session
|
||||
session_start();
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
/*
|
||||
|
@ -32,7 +32,7 @@ if (isset($_POST['submit'])) {
|
|||
if (empty(trim($_POST["new_password"]))) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Meep', 'Enter a new password!', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Meep', 'Enter a new password!', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -40,7 +40,7 @@ if (isset($_POST['submit'])) {
|
|||
} elseif(strlen(trim($_POST["new_password"])) < 6) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Not long enough...', 'Password, must be 6 or more characters in length uwu', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Not long enough...', 'Password, must be 6 or more characters in length uwu', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -53,7 +53,7 @@ if (isset($_POST['submit'])) {
|
|||
if (empty(trim($_POST["confirm_password"]))) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Meep', 'You must confirm the password!!!!', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Meep', 'You must confirm the password!!!!', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -63,7 +63,7 @@ if (isset($_POST['submit'])) {
|
|||
if(empty($error) && ($new_password != $confirm_password)) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('AAAA', 'Passwords do not match!!!', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('AAAA', 'Passwords do not match!!!', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -89,14 +89,14 @@ if (isset($_POST['submit'])) {
|
|||
session_destroy();
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Password updated', 'Now goodbye.... you will be redirected in a moment', 'var(--green)', '../assets/icons/check.svg');
|
||||
setTimeout(function(){window.location.href = "../account/login.php";}, 2000);
|
||||
sniffleAdd('Password updated', 'Now goodbye.... you will be redirected in a moment', 'var(--green)', 'assets/icons/check.svg');
|
||||
setTimeout(function(){window.location.href = "account/login.php";}, 2000);
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Bruh', 'Something happened on our end, sowwy', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Bruh', 'Something happened on our end, sowwy', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
session_start();
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
include "../app.php";
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
include dirname(__DIR__)."/app.php";
|
||||
|
||||
use App\Account;
|
||||
use App\Image;
|
||||
|
@ -37,16 +37,16 @@ if (isset($_POST['submit_delete'])) {
|
|||
// Attempt to execute the prepared statement
|
||||
if (mysqli_stmt_execute($stmt)) {
|
||||
// See if image is in the directory
|
||||
if (is_file("../../images/".$image_array['imagename'])) {
|
||||
unlink("../../images/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/images/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/".$image_array['imagename']);
|
||||
}
|
||||
// Delete thumbnail if exitsts
|
||||
if (is_file("../../images/thumbnails/".$image_array['imagename'])) {
|
||||
unlink("../../images/thumbnails/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/images/thumbnails/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/thumbnails/".$image_array['imagename']);
|
||||
}
|
||||
// Delete preview if exitsts
|
||||
if (is_file("../../images/previews/".$image_array['imagename'])) {
|
||||
unlink("../../images/previews/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/images/previews/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/previews/".$image_array['imagename']);
|
||||
}
|
||||
// TP user to the homepage with a success message
|
||||
?>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
session_start();
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
include "../app.php";
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
include dirname(__DIR__)."/app.php";
|
||||
|
||||
use App\Make;
|
||||
|
||||
|
|
|
@ -9,11 +9,6 @@ $conn_username = "uwu";
|
|||
$conn_password = "fennec621";
|
||||
$conn_database = "gallery";
|
||||
|
||||
/*
|
||||
echo $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['SCRIPT_NAME']);
|
||||
echo $_SERVER['PHP_SELF'];
|
||||
*/
|
||||
|
||||
$conn = mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
|
||||
if ($conn->connect_error) {
|
||||
?>
|
||||
|
|
|
@ -1,16 +1,4 @@
|
|||
<script>
|
||||
console.log("⣿⣿⣿⣿⣿⡿⠿⠻⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠻⠻⠟⠻⢿⣿⣿⣿⣿\n\
|
||||
⣿⣿⡟⠁⢀⣠⣤⣤⣤⣤⣄⣀⣀⣀⣹⣿⣿⣷⣄⣀⣀⣀⣀⣤⣤⣤⣤⣀⠐⢽⣿⣿⣿\n\
|
||||
⣿⣿⣿⣶⣿⡿⣛⡒⠒⠒⢒⠒⣲⠙⣿⣿⣿⣿⠟⣵⡒⢒⠒⠒⡀⣘⡻⣿⣿⣾⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣏⣞⡛⠃⠀⠀⠸⠷⢿⣧⣿⣿⣿⣿⣧⣿⣷⣛⣀⣀⣁⣛⣛⣮⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏⣾⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢻⣿⠏⣼⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⡿⢿⣿⣿⣿⣿⣿⣿⡿⠿⠿⠿⠟⢛⣉⣴⣿⡏⣸⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣧⣠⣤⣤⣤⣤⣤⣤⣶⣶⣶⣶⣿⣿⣿⣿⣿⠃⣿⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿");
|
||||
|
||||
console.log(". . /|/| . . . . . . .\n\
|
||||
.. /0 0 \\ . . . . . ..\n\
|
||||
(III% . \\________, . .\n\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue