Hi there,
I'm a newbie to PHP so bare with me on these questions. :-)
I'm looking for a mechanism that is working in the most effient way:
In my website, I show cars. Each car has multiple pictures.
I want to build a 'true' counter of hits per car.
If a user clicks on any of the car's pics, it registers only one hit
on the server.
To maintain the no repeat hits, I want to place a cookie on the user's
machine and have it checked to see if it holds the specific car's ID.
It doesn't matter which Picture of that car the user clicks on.
I'm not sure what mechanism to use to make this happen:
I thought I'd have a session started at the index.php file
and load a cookie from the user's computer (if exists) into the session. Then, in the session, I'd have all the previous cars
that were visited before, and increment or not based on the CarID.
However, I'm not sure how to implement a GetCookie Into a Session.
Having the GetCookie loaded into the session, will remove the need
to do a getCookie again for each car (unless the CarID is not registered in the cookie, and at that time it will also do a SetCookie).
Any takers?
-Alon.