mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-02 08:23:13 +00:00
Random Group fixes
This commit is contained in:
parent
8ecd3f5921
commit
d8f2166a1f
8 changed files with 151 additions and 36 deletions
|
@ -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);
|
||||
|
|
|
@ -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'];
|
||||
?>
|
||||
<script>
|
||||
window.location.replace("index.php?del=true&id=<?php echo $_POST['id']; ?>");
|
||||
window.location.replace("index.php");
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue