GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   More php help needed :) (https://gfy.com/showthread.php?t=193828)

4Pics 11-05-2003 01:57 AM

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

jwerd 11-05-2003 02:16 AM

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

4Pics 11-05-2003 02:41 AM

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.

fris 11-05-2003 03:12 AM

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.

Nightwork 11-05-2003 03:31 AM

Quote:

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.
That's what I think as well :)

If you want to go with the cookie, store the data in an array...

4Pics 11-05-2003 10:29 AM

Bump for anyone elses opinion

Nightwork 11-05-2003 10:41 AM

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