The Avatar
25-10-2004, 09:59 PM
Hoakay,
Ive developed a web counter for my site that tracks each time a user logs onto my main page and when a user goes to the downloads page. Main page is autoloaded each time a user goes to the site, so that becomes the visits stat, while if a person goes to the downloads page the counter will increment the downloads stat.
It works fine on my home web server, but when I uploaded it to my 1337.as hosting service the scripts dont seem to execute. here is the code for incrementing the conter for the main page:
<?PHP
$file = fopen("../Logs/Arachnoid.txt", "r");
$Views = fgets($file,1024);
$Dloads = fgets($file,1024);
$New_Views = $Views + 1;
fclose($file);
$file = fopen("../Logs/Arachnoid.txt", "w");
flock ($file, LOCK_EX);
fputs($file, $New_Views);
fputs($file,"\n"); // Makes sure the next value goes on a new line!!
fputs($file, $Dloads);
flock ($file, LOCK_UN);
fclose($file);
?>
and here is the displaying code:
<?PHP
$file = fopen("../Logs/Arachnoid.txt", "r");
$Views = fgets($file,1024);
$Dloads = fgets($file,1024);
fclose($file);
?>
Why does it not work online, and yet it works perfectly off-line in my web server?
Ive developed a web counter for my site that tracks each time a user logs onto my main page and when a user goes to the downloads page. Main page is autoloaded each time a user goes to the site, so that becomes the visits stat, while if a person goes to the downloads page the counter will increment the downloads stat.
It works fine on my home web server, but when I uploaded it to my 1337.as hosting service the scripts dont seem to execute. here is the code for incrementing the conter for the main page:
<?PHP
$file = fopen("../Logs/Arachnoid.txt", "r");
$Views = fgets($file,1024);
$Dloads = fgets($file,1024);
$New_Views = $Views + 1;
fclose($file);
$file = fopen("../Logs/Arachnoid.txt", "w");
flock ($file, LOCK_EX);
fputs($file, $New_Views);
fputs($file,"\n"); // Makes sure the next value goes on a new line!!
fputs($file, $Dloads);
flock ($file, LOCK_UN);
fclose($file);
?>
and here is the displaying code:
<?PHP
$file = fopen("../Logs/Arachnoid.txt", "r");
$Views = fgets($file,1024);
$Dloads = fgets($file,1024);
fclose($file);
?>
Why does it not work online, and yet it works perfectly off-line in my web server?