Can anyone help me achieve this:
So basically, I have a gallery system, let’s assume that I created a gallery on e.g gallery.php but then I realized that I don’t like it – so I want to delete it. I have a link under the gallery that says delete e.g. <a href="delete_gallery.php?id=1">Delete</a>, whenever I click on the delete link and then when it successfully deletes it redirects me to gallery.php (and here’s what I need), I want to display a message on gallery.php that a gallery has been deleted. This message should only be displayed when a user gets redirected from delete_gallery.php?id=1 to gallery.php after a successfull removal of the gallery.
I was thinking of doing something like this:
if (empty($errors)) {
delete_gallery($gallery_id);
header('Location: gallery.php?delete_success');
exit();
}
And now, I need a code that will display a message on gallery.php when a user got redirected to gallery.php?delete_success.
I tried my best explaining it but even I don’t know what I am saying:D LOL!
@edit
Or maybe this might work:
if ($_GET == gallery.php?delete_success) {
echo "Gallery successfully deleted.";
}
Do you think that this might work? (Haven’t tried it).
1 Answer