View Full Version : how to write an effitient counter?
durong
January 13th, 2003, 05:36
i made one,but it's too hard to load
ECTrimble20
January 15th, 2003, 14:55
ok 2 solutions, 1) if you've got a mysql database simply call the count, which should be an 'int', then do a loop to add one to the loop, with a $count++; type thing. 2) No database available try doing a simple addfunction to a flat text file where it calls it, reads the value of the text file, adds to it, then rewrites it.
Canuckkev
January 15th, 2003, 15:24
An efficient way is to load it as an image, but the src points to"filename.php" (assuming it's a php script, if not, the .pl, or .asp, or whatever). Then, in the .php file, have it load a blank image (1x1 transparent), but do the other processing (adding hit, etc). Any sort of client side stuff (JavaScript) will severely slow down loading time.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.