There is a problem. I don't want that people would be able to refresh one page on my site. How can I do it?
Refresh is a browser side solution. You can't restrict it from server side.
What you can do is actually to use PHP's SESSION to actually prevent people from visiting any page twice.
<?php
session_start();
if(!isset($_SESSION['disablethispage'])){
$_SESSION['disablethispage'] = true;
// serving the page first time
}else{
// visited before or page was refreshed
}
However user is still able to come back to the same page if he/she removes the session cookie for your website.
If you're talking about double posting, you might want to look at the POST-REDIRECT-GET Solution. See: http://en.wikipedia.org/wiki/Post/Redirect/Get
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With