0

Hi,

When I click BACK button on my Browser, all old variables were sent to URL are retrieved again. How can I destroy them?

Thanks

3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by veledrom
0

As far as I know it isn't possible to removes ones url history but perhaps you should consider $_POST. Then the user will need to confirm the post request and if they do you should then get the server to check if the same post request has been sent in the last 48 hours. Mysql or maybe even sessions could help you there. If you could post some code then I will help you implement these features.

0

I have 5 combo boxes and I use OnChange event not to use 5 submit buttons or 5 different pages to process selections because each selections populate data to next combo. I use one Submit button to finalise the process. I didn't want to use any button for selections.

<select name='select' onChange='window.location.href=this.value'>
<option value='?intID=$intID&intD=$intD'>$intDate</option>
</select>

Edited by veledrom: .

0

this is an interesting thread... im also curios if you there is a way on solving that problem coz. the back button is specially made for that... for viewing your previously viewed page. i dont know if there's really a code for that.. i dont know... maybe?

0

Try placing this at the top of each page.

<?php
session_start();
if (!empty($_GET)) {
for ($i=0;$i<count($_SESSION['GET']);$i++) {
    if ($_SESSION['GET'][$i]==$_GET) {
        die('This page has already been viewed.');
        }
    }
$_SESSION['GET'][]=$_GET;
}
?>

Edited by cwarn23: new code

0

Instead of sending header and URL to current page to be process variables, I send it to other page to process URL variables and redirect back to actual page. If anyone click BACK button, no error would be generated in this way. I simply don't deal with variables in same page anymore. It is better.

index.php

<select name='select' onChange='window.location.href=this.value'><option value='otherpage.php?intID=$intID&intD=$intD'>$intDate</option></select>

otherpage.php

......some code
$_SESSION["intID"] = $_GET["intID"];
$_SESSION["intD"] = $_GET["intD"];
header("location:index.php");
exit;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.