Forum Moderators: coopster
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/_structure/
RewriteRule !\.(gif|jpg|png|css)$ _structure/item.php
<?
$fn='hits.txt';
$hits=file($fn);
$hits[0]++;
$f=fopen($fn,'w');
fwrite($f,$hits[0]');
fclose($f);
?>
<?php
$fn='hits.txt';
$hits=file($fn);
$hits['0']++;
$f=fopen($fn,'w');
fwrite($f,$hits['0']);//I missed the ticks from here
fclose($f);
?>
<?php
$fn='hits.txt';
$hits=file($fn);
print_r($hits);
$hits['0']++;
$f=fopen($fn,'w');
fwrite($f,$hits['0']);
$newhits =file($fn);
fclose($f);
print_r($newhits);
?>
<?
$hits=file('hits.txt');
echo 'Pageviews: '.$hits[0];
?>
$hits['0']++;
$f=fopen($fn,'w');
fwrite($f,$hits['0']);
<?php
$hits=file('hits.txt');
echo "Pageviews: ".$hits['0'];
?>
<?php
$file = "count.txt";
if (file_exists($file)) {
$fp = fopen("$file", "r+");
flock($fp, 1);
$count = fgets($fp, 4096);
$count += 1;
fseek($fp,0);
fputs($fp, $count);
flock($fp, 3);
fclose($fp);
} else {
echo "Can't find the darn file, check '\$file'<br />";
}
?> <?php include ("count.php");?>