Pioneer Skin
Login  ::  Register
Saturday, May 19, 2012
 
- - - - - - - - Sponsorship Advertisement Area - - - - Thank you to our Sponsors - - - - - - - - -
New Horizons Computer Learning Centers

We are please to introduce the new and improved discussion forum. It should eliminate the issues we've been having with the discusson board in the past. The old forum will still be available in "read only" mode HERE in case anyone wants to review the old topics that were posted.

WGD Forum: Discussion
Subject: Simple Hit counter
Prev Next
You are not authorized to post a reply.

Author Messages
Kristin123User is Offline

Posts:0


10/16/2008 4:13 AM  

A hit counter will let us know how many times a page is accessed. In case one visitors loads the page several times, the hit counter will increase several times (but this is likely to happen only a few times).

The code for the hit counter bellow will save the number of hits in a file named
counter.txt (the name of this file may be changed). Each time the page is loaded, the file will be read, the number will be increased by one and the new number will be saved to the same file.

 


//The file where number of hits will be saved; name may be changed; p.e. "/counter_files/counter1.txt"
$counterfile = "
counter.txt";

// Opening the file; number of hit is stored in variable $hits
$fp = fopen($counterfile,"r");
$hits = fgets($fp,100);
fclose($fp);

//increading number of hits
$hits++;

//saving number of hits
$fp = fopen($counterfile,"w");
fputs($fp,
$hits);
fclose($fp);

//printing  hits; you may remove next line (and keep the counter only for your records)
print
$hits;

?>

To use this code, copy it to your page in the exact position where you want to show number of hits.

 

http://www.infysolutions.com

outsourcing software development

tgoodsonUser is Offline
Newbie
Newbie
Posts:33


11/05/2008 2:17 AM  

Probably ought to specify that that is PHP code (there are other scripting languages, you know.)  I've been using something simular for quite a while now, works great.

** Tom **

xixi001User is Offline
Regular Contributor
Regular Contributor
Posts:98


04/16/2012 3:54 AM  

P57 Hoodia is South Africa butterfly and (Hoodia) edible cactus the efficient components, the only global health, Hoodia P57 Pills safety of natural appetite inhibitors, can allow the brain to produce full abdomen move illusion, and P57 Hoodia Cactus Slimming Capsule reduce the intake of calories and fat. In Britain and the United States of human clinical trials, edible p57 hoodia slimming lose weight than the crowd of people eating placebo every day on average intake reduced the quantity of heat of 10000 calories, hoodia p57 diet pills weight loss obviously and no side effect. For more information please visit http://www.hoodiap57.org

You are not authorized to post a reply.
Forums > Web Design > Programming > Simple Hit counter



ActiveForums 3.7
Home | Membership | Events | Forum | MyPage | Login
Copyright 2007-2008 by WGD Forum :: Designed by ZapWebDesign.com