I have a basic script that prevents reaping of our database, offering only a few records to a user:
I can reset the counter by simply passing the URL of:
The session counter does not seem to be consistently working. I have been debugging the script by placing the $_SESSION[counter] variable in the page title. I watch as it jumps from 1 to 2 to 1 to 3 to 4 to 5 to 5 to 6 to etc...
It seems like it is trying to do its thing but it may be going haywire on proxy/firewall caching. Can anyone explain why this is happening and how to fix? Is there some sort of PHP header trick or should I simply place a 'pragma nocache' meta tag in the HTML header? Or am I simply going in the wrong direction?
- - picklefish - -
Code:
<?php
//START OF PAGE
session_start();
$_SESSION[counter]++;
if ($_GET[count]=="reset"){ $_SESSION[counter]=0; }
//LATER IN THE PAGE...
if ($_SESSION[counter]<=8) {
//DISPLAY DATA
}
?>
I can reset the counter by simply passing the URL of:
Code:
[URL unfurl="true"]http://www.domain.com/page.php?counter=reset[/URL]
The session counter does not seem to be consistently working. I have been debugging the script by placing the $_SESSION[counter] variable in the page title. I watch as it jumps from 1 to 2 to 1 to 3 to 4 to 5 to 5 to 6 to etc...
It seems like it is trying to do its thing but it may be going haywire on proxy/firewall caching. Can anyone explain why this is happening and how to fix? Is there some sort of PHP header trick or should I simply place a 'pragma nocache' meta tag in the HTML header? Or am I simply going in the wrong direction?
- - picklefish - -