Hello everyone.
This is my first post to this forum...
I am writting a script to track impressions of images paths that are strored in mysql.
I want my images to be referenced in this format:
<a href="http://domain.com/click/click_id"><img src="http://domain.com/image/image_id" alt="Click Here" border="0"></a>
I'm working on the impression script but I am having some issues with caching.
When the user sees the HREF above, the "image" script pulls the proper image out of the DB and displays it with no problem.
Each time the "image" script is called, I insert a row into a table called "impressions" to log the event along with the image_id that was displayed.
This is working fine...
However, I'm trying to track unique impressions with this script.
As it is now, if the user hits REFRESH on the browser 10 times, then my script will log 10 impressions into the DB.
I need the script to only log one impression. If the user hits CTRL+REFRESH then another impression should be logged.
I do not want to use a SESSION or COOKIE to accomplish this task. I've seen other applications using the same linking format and achieving the same functionality.
My script is using one header() to display the image from the DB like this:
header("Location: ".$image_path."");
I've been looking everywhere on the search engines about CACHE and I'm just not seeing the solution.
I thought that by nature, browsers cached <IMG SRC> tags?
I look forward to your feedback...
Thanks,
Ben