I am working on pages which are secured so no-one can link to that page using this:
Code below is called inside a loop.
$gentok = uniqid();
if(isset($_GET["action"]) && $_GET["action"] == "clean_$gentok") {
// stuff
}
Then, I have this to call the URL:
<a href="<?php echo admin_url("themes.php?page=cleaner&action=clean_$gentok"); ?>">Clean this and that</a>
But when clicking the link, the page refreshes and the uniqid()
has already changed.
How can I make it so the uniqid()
is still the same after the page refresh? I'm open for any changes or better ideas you may have.
Thank you!