![]() |
More php help needed :)
I want to log clicks on a exit console as such
http://www.blah.com/out.php?id=1 http://www.blah.com/out.php?id=2 http://www.blah.com/out.php?id=3 http://www.blah.com/out.php?id=4 http://www.blah.com/out.php?id=5 The 2 ways I can log hits are either use cookies, or log the ip address and if its not used in last 1-24hrs then count it as a unique. If I am using cookies, how do I store it so I know what links are unique for them the easiest way? Like <? if (!isset($_COOKIE['$id']) ) { add click for id setcookieforid } ?> Is there a short way to store the id's? or will the cookie file be huge if I have like 500 id's they could click? Thanks |
Well, from the code shown you will be creating a new cookie for each entry... so that will be like 500 cookies with a value in each of them.. the problem with this is most comptuers will only receive 1 cookie per connection (URL) so ... that can turn into a problem... I'd just log the IP, and have it clear out daily... that is your best bet... store the ips in a database and then if it is the next day, it checks, and if it is, resets the ip address log and adds the value simple as that
|
It doesn't create a new cookie if one already exists for that domain. It just adds a the cookie variable.
or atleast that is how it works with IE6. |
best way would be to create a mysql database and store the values in there. and go from there. its pretty much easy from there.
|
Quote:
If you want to go with the cookie, store the data in an array... |
Bump for anyone elses opinion
|
you got mine opinion, where the hell do you need some more for ;)
|
| All times are GMT -7. The time now is 11:10 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123