Page 1 of 1
site statistics - number of clicks
Posted: Thu May 20, 2004 9:48 pm
by gaurav_sting
hi,
i am stuck in a problem, kindly help.
i am making a site, in which the visitor clicks on apply (for a credit card), now, how can i know that how many times apply for a card has been clicked by the user, i need to create a statistics that for a particular card - n number of times apply was clicked.
Thank you,
Gaurav
Posted: Thu May 20, 2004 9:51 pm
by tim
Posted: Thu May 20, 2004 10:01 pm
by launchcode
Do you mean the number of times that link was clicked? Or the number of times any one single user clicked the link??
Posted: Thu May 20, 2004 10:01 pm
by d3ad1ysp0rk
- have the link "apply for card" go to "log.php"
- on log.php:
* open a text file with fopen
* get the number out of it
* add one to the number
* save the new number (replacing the old one)
* set a cookie to let your script know it's already been clicked by that person
* redirect to the original link
Posted: Thu May 20, 2004 10:05 pm
by tim
if you have MySQL db, that would be better than a txt file.
Posted: Thu May 20, 2004 10:07 pm
by d3ad1ysp0rk
It's pointless. Why waste a whole db and table for ONE value?
Textfile is perfect for this.
Posted: Thu May 20, 2004 10:08 pm
by tim
notice i said 'if'
I, personally, find it more easy to use SQL commands than fwrite n fopen.
thats just me, either way it gets the job done.

Posted: Thu May 20, 2004 10:11 pm
by doggy
I don`t compily anderstand what you wanne do but you could but you could but a insert sql on that page and every time it loads it counts a hit or if you want to make the hits per user how many times the user on his own did click you can set it in a session and then once the user did enter every thing and is done then count the finil session to a text file or a database. I hope this hopes and didn`t just waste pasteing space.