hello everyone,
Atm I’m trying to make a counter reseter work, but no luck.
Here is content of the reset_counter.php:
[code=php]<?php
$reset = “0”;
$file = “counter.txt”;
$handle = fopen ($file, “r”);
$contents = fread ($handle, filesize ($file));
fclose ($handle);
print “Total number of views: <b>$contents</b>”;
$date = date(‘h:i:s’);
$translate = ‘echo $date | tr : .’;
$command = ‘echo $contents > backup/counter_$translate.txt’;
system(“$translate”);
exec(“$command”);
$fp = fopen($file,”w”);
fwrite($fp,$reset);
fclose($fp);
?>
I tried to allow the safe exec dir in htaccess, but then it gave me error 500.
Any straight answers will be appreciated.