mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-21 01:10:37 +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,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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue