php - Counting how many times a image is being served from server? -
I want to count the number times One image is being served to our server. I have some images in a website and I Number is to be calculated. When these images are shown on the web page (the server is served on my website and hotlinks). Is there any way to accomplish this. I know php, if this is done in PHP in some way it would be really helpful.
Please advice
Thank you.
If you want something beyond parsing the server-logging, then you need to manage the list of pictures Have to set up a database, and serve images through several times' reused '.php' scripts which increases the DB value with each request. You can also use a flat file system, but I like the DB-solution.
If you apply mod_rewrite to .htaccess and apache, you will not need to worry about the source of your image. You can serve URLs in this way:
http://mysite.com/images/001.jpg
Which server will be deemed to be:
http://mysite.com/images.php?id=001
Thus providing database-based actions, and the basis for executing scripted logic.
Comments
Post a Comment