iostream71
Programmer
i was using this script to test a no reloading hit counter:
<?php
session_start();
$filename = "counter.dat";
$fp = fopen ($filename, "r"
$hits = fread ($fp, filesize($filename));
fclose ($fp);
//add hit if no session active
if (!isset($HTTP_SESSION_VARS['count'])) {
//was using: session_register('count'); but never
//would enter 'if'
$HTTP_SESSION_VARS['count'] = 1;
$hits++;
$fp = fopen( $filename,"w"
fwrite($fp, $hits, filesize($filename));
fclose( $fp );
}
//write to flash
print "&counterValue=";
print $hits;
?>
problem is, it resets to 1 after 10 hits every time.
here is my phpinfo:
<?php
session_start();
$filename = "counter.dat";
$fp = fopen ($filename, "r"
$hits = fread ($fp, filesize($filename));
fclose ($fp);
//add hit if no session active
if (!isset($HTTP_SESSION_VARS['count'])) {
//was using: session_register('count'); but never
//would enter 'if'
$HTTP_SESSION_VARS['count'] = 1;
$hits++;
$fp = fopen( $filename,"w"
fwrite($fp, $hits, filesize($filename));
fclose( $fp );
}
//write to flash
print "&counterValue=";
print $hits;
?>
problem is, it resets to 1 after 10 hits every time.
here is my phpinfo: