How to track clicks on a php element? [duplicate]
Possible Duplicate:
How to set cookies for uuid
Hello, I have a unique id generator ( uniqid() ) on my site which generates a unique id for every new visitor (the id's are saved in cookies for every user). Each visitor gets their own special link in this format: http://website.com/id=12345. Check out my site to see what i mean: (please don't say that im "phishing", "scamming", etc. 开发者_如何转开发This site project is actually going to be a real working system when complete.) http://freexboxlivecodes.cz.cc
My question is how to track unique clicks on the unique link every vistor gets using php. I tried some scripts but they all require that i paste a specific page to track. If anyone knows how this can be done, please answer. Thanks.
The only honest answer is: You can't. There are basically two possible approaches, but all of them flawed:
- Using a cookie: Cookies can be deleted, quite simply.
- Using the IP-address: Depending on your provider your IP will change every now and then. Furthermore a proxy server may be used.
Set a cookie and store the IP. If the cookie exists or the IP has accessed the link recently, do not count the click.
Using something like evercookie might also be helpful against cheaters.
精彩评论