|
How to install | Troubleshooting
Difficulty: Easy
Time it takes to install: Less than 5 minutes
Rating: 3/5 (228 total votes)
(Rate this script!)
Installation instructions:
- Download the PHP Files
- Open your PHP file that you want to have update the number of visits on your website (You might only like only one page to update the hits, or you might like it to be site wide) or use index.php as an example.
- Put the following code into the TOP of your page, before any HTML tags.
<?php include('counter.php'); update_hits(); ?>
- Put the following code where you want the number of hits to be displayed
<?php echo(display_hits()); ?>
- Upload your file plus the counter.php and hits.data files to your webserver.
- Set the write permissions on the hits.data file (More info on this in a minute)
- Browse to your file (www.mywebserver.com/file.php)
- Refresh the page.
- Watch the hits go up!
You will need to set write permissions for the hits.data file. To do this, you need to open your FTP program and right click on the file on your webserver, and click CHMOD or set permissions. You can set the number to 0666 or check all the write and read boxes.
Troubleshooting:
There was an error finding the data file, please check that the data file (hits.data) exists.
This means that your hits.data file is not in the directory that your main file is in. You will need to create a file in the directory that your main file is in. NOTE: If you have some files in different directories, and not all in one folder, you might need to change the code so that it knows where to look. If you don't, you can have several different number of hits.
There was an error reading the data file (hits.data), please check that you have set permissions to allow this script to read the file.
This means that your data file has been told not to let anyone read it, you will need to set CHMOD permissions to do this (More on this above).
There was an error updating the hit count, please check that you have set the correct permissions for the data file (hits.data).
This means that your data file has been told not to let anyone change it, you will need to set CHMOD permissions to do this (More on this above).
By: Zaruhk
This script was entered into the database on Monday 02 June, 2008 by spdaniel91
^^ Back to top ^^
|