diff --git a/app/image/group.php b/app/image/group.php index 0f1e1b7..265b5fa 100644 --- a/app/image/group.php +++ b/app/image/group.php @@ -120,7 +120,7 @@ if (isset($_POST['title_submit'])) { if (isset($_POST['new_group_submit'])) { if ($user_info->is_loggedin()) { - $group_name = $_SESSION['username']." new image group"; + $group_name = $_SESSION['username']."\'s Group"; $sql = "INSERT INTO groups (group_name, author, image_list) VALUES('$group_name', '".$_SESSION['id']."', '')"; mysqli_query($conn, $sql); diff --git a/app/image/image.php b/app/image/image.php index 4a898ff..ee6425b 100644 --- a/app/image/image.php +++ b/app/image/image.php @@ -31,10 +31,7 @@ if (isset($_POST['submit_delete'])) { // Delete from table $sql = "DELETE FROM images WHERE id = ?"; if ($stmt = mysqli_prepare($conn, $sql)) { - mysqli_stmt_bind_param($stmt, "i", $param_id); - - // Setting parameters - $param_id = $_POST['id']; + mysqli_stmt_bind_param($stmt, "i", $_POST['id']); // Attempt to execute the prepared statement if (mysqli_stmt_execute($stmt)) { @@ -52,9 +49,10 @@ if (isset($_POST['submit_delete'])) { } // TP user to the homepage with a success message mysqli_query($conn,"INSERT INTO logs (ipaddress, action) VALUES('$user_ip','Deleted image ".$_POST['id']."')"); + $_SESSION['del'] = $_POST['id']; ?>