Page 1 of 1

How to get the number of views for a topic in a blog

Posted: Thu Jul 30, 2009 7:30 am
by syamswaroop
I have devolped a blog with php . now i have saved that blog content in a php file
now how to know how many views are there for that php file and also basically what is exactly meant by view and how to rate that blog using php

Re: How to get the number of views for a topic in a blog

Posted: Thu Jul 30, 2009 7:33 am
by jackpf
You could have a field called `Counter` or something for each entry in the database. You could then increment the counter each time someone visits that entry.

You might also want to set a cookie that expires in 10 minutes or something, and only update if that cookie doesn't exist though, because someone could just hold down f5 and completely invalidate your stats.

Re: How to get the number of views for a topic in a blog

Posted: Thu Jul 30, 2009 7:59 am
by syamswaroop
Thank you very much

Re: How to get the number of views for a topic in a blog

Posted: Thu Jul 30, 2009 8:09 am
by jackpf
No problem :)