I have links that add a row to the database and then redirect to another page. In that page I want to show a message of success if it came from the insert page however the HTTP_REFERER
doesn't acknowledge that page as the referer and instead shows the previous page.
So page-one.php
contains a hyperlink:
http://example.com/add.php?c=359
and on add.php
header('Location: http://example.com/rows.php');
on rows.php I am expecting add.php to be the referer but it isn't instead page-one.php is.
How do I make add.php to be the referer cos that's where it is being redirected from?
The usual way it is with
$_SESSION
variables. Whenever you need to show a message add it:Then, when you are on a page (any non-redirected page), show all of them and erase the content with: