Greetings all,
Just want to hear other people’s point of view. So, I have built this pretty much simple forums page for my website and one of the scripts (viewforum.php), when clicked, displays a table with different topics (threads). And one of the columns of this chart is called “Views”, which stands for “number of times each column has been viewed”. So, what I did is: when a person clicks’s on the topic’s (thread’s) title, a person is taken to view that thread and an DML SQL statement updates the column value for that specific topics which was clicked. The SQL is:
UPDATE topics
SET visits = visits + 1
WHERE id = '$topic_id'
Please note, the default of “visits” column is 0.
What I am worried about is a possible value manipulation. There is really no benefit or harm if someone simply keeps on refreshing a page and the value of “visits” will be incremented. But it still kind of feels wrong and I believe I am doing something wrong.
Please advise, what would be a correct or better way to implement the feature.
Thanks.