Hi guys,
I'm trying to create a back button script that can go back endlessly but it doesn't work as expected and I'm starting to lose my mind on it
Here is what I've done so far :
I think that my logic is flawed
What happens is that the button works only once (not very efficient ahaha)
BTW : of course I know that there already is a back button on the browser
Many thanks to the one who will have some idea to share!
I'm trying to create a back button script that can go back endlessly but it doesn't work as expected and I'm starting to lose my mind on it
Here is what I've done so far :
Code:
if ($_GET["ngb"] == 1) {
$dump = @array_pop($_SESSION["go_back"]["history"]);
}
$_ngb[0] = $_SESSION["go_back"]["history"];
$_ngb[0] = @array_pop($_ngb[0]);
if ($_ngb[0] == "") $_ngb[0] = $_SERVER['HTTP_REFERER'];
$script_output = "
" . $_ngb[0] . "?ngb=1
";
if ($_GET["ngb"] != 1) {
$_SESSION["go_back"]["history"][] = $current_url;
}
I think that my logic is flawed
What happens is that the button works only once (not very efficient ahaha)
BTW : of course I know that there already is a back button on the browser
Many thanks to the one who will have some idea to share!