how to calculate views?
-
Hi, I have articles web project. I want to calculate the views of every article, just like the views of post in forums. I created a table article_views with article_id, view_date, view_ip so everytime the page will load it will add a record but that is a problem because anyone can refresh the page to increase the views! what's the proper way to do it please? Thanks, Jassim
Technology News @ www.JassimRahma.com
-
Hi, I have articles web project. I want to calculate the views of every article, just like the views of post in forums. I created a table article_views with article_id, view_date, view_ip so everytime the page will load it will add a record but that is a problem because anyone can refresh the page to increase the views! what's the proper way to do it please? Thanks, Jassim
Technology News @ www.JassimRahma.com
Hi Try to validate using viewstate. When the page loads, increase the view count by comparing the viewstate object to null. Then take an object in viewstate. Second time when the user refreshes the page, viewstate object exists and skip the count increment. Please give a try and let me know how this worked. Thanks Naina
Naina
-
Hi Try to validate using viewstate. When the page loads, increase the view count by comparing the viewstate object to null. Then take an object in viewstate. Second time when the user refreshes the page, viewstate object exists and skip the count increment. Please give a try and let me know how this worked. Thanks Naina
Naina
Which programming language? In PHP you can use sessions to prevent data refresh after page load.
-
Hi, I have articles web project. I want to calculate the views of every article, just like the views of post in forums. I created a table article_views with article_id, view_date, view_ip so everytime the page will load it will add a record but that is a problem because anyone can refresh the page to increase the views! what's the proper way to do it please? Thanks, Jassim
Technology News @ www.JassimRahma.com
Which programming language, you are using? In PHP use sessions to prevent data refresh after page load.