|
Posted by Dana Cartwright on 04/11/07 16:16
>>>> I just wondered what methods people used typically when trying to guard
>>>> against a POSTed script being reloaded at the users browser and
>>>> effectively re-posting the same data again ?
I've used a method that essentially combines (with modifications) the two
ideas you've already been presented with.
If there is $_POST data present, I put it into the $_SESSION variable,
something like:
$_SESSION[ 'post_data' ] = $_POST;
and then I force a reload of the page.
Now, if the page loads WITHOUT $_POST data, but WITH $_SESSION[
'post_data' ] present, then I do the processing and null out $_SESSION[
'post_data' ].
I don't know if this is foolproof (I suspect it's not), but it's been quite
effective where I've used it.
Navigation:
[Reply to this message]
|