Warning: Undefined array key "HTTP_ACCEPT_ENCODING" in /home/freeguppyorg/sites/ghc.freeguppy.org/inc/hpage.inc on line 45
GuppY Help Center - Add a page view counter
 

GuppY Help Center, help online, documentation and tutorials

telecharger.png

You are here :   Welcome » Add a page view counter
    Print this page...

Add a page view counter

To add a visit counter (to count the number of times the page was displayed), you need to have a file to store the count data and modify a few lines in the sample.php file, in which you will increment the counter.

Find the following lines:
define('CHEMIN', '../');
include(CHEMIN."inc/includes.inc");

After this lines add the following:
$­­file = CHEMIN.'data/my_counter.dtb';
$­­­­­­­­­count = ReadCounter($­­file) + 1;
WriteCounter($­­file, $­­­­­­­­­count);

Replace the file name "my_counter.dtb" by the name of your data file. (that you created to store this information)

Use the $­­­­count variable to display the counter value ( for example: echo $­­­­count; )

Creation date : 26/10/2006 @ 15:57
Category : FAQ GuppY <= 4.6.xx - Sample PHP
Page read 16583 times