unsider Posted July 12, 2008 Share Posted July 12, 2008 How is this done? I looked for a few articles on google, but unfortunately couldn't find anything relavent. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/114468-retrieving-the-of-page-views/ Share on other sites More sharing options...
teynon Posted July 12, 2008 Share Posted July 12, 2008 You'd have to log page views on your site in a file or database. Quote Link to comment https://forums.phpfreaks.com/topic/114468-retrieving-the-of-page-views/#findComment-588585 Share on other sites More sharing options...
unsider Posted July 12, 2008 Author Share Posted July 12, 2008 Ya, but that's what I'd like to know. How is this done? Quote Link to comment https://forums.phpfreaks.com/topic/114468-retrieving-the-of-page-views/#findComment-588587 Share on other sites More sharing options...
teynon Posted July 12, 2008 Share Posted July 12, 2008 General page views: <?php $pageviews=file_get_contents("counter.txt"); $pageviews++; file_put_contents($pageviews); Quote Link to comment https://forums.phpfreaks.com/topic/114468-retrieving-the-of-page-views/#findComment-588588 Share on other sites More sharing options...
DeanWhitehouse Posted July 12, 2008 Share Posted July 12, 2008 or you can use a database Quote Link to comment https://forums.phpfreaks.com/topic/114468-retrieving-the-of-page-views/#findComment-588593 Share on other sites More sharing options...
teynon Posted July 12, 2008 Share Posted July 12, 2008 Thanks for that blade... heh... read the second post Quote Link to comment https://forums.phpfreaks.com/topic/114468-retrieving-the-of-page-views/#findComment-588596 Share on other sites More sharing options...
JasonLewis Posted July 13, 2008 Share Posted July 13, 2008 That would count when people just say there refreshing. You can delve further into this by using a database (as mentioned above ) then having a unique counter. Where the person's IP is added to the database, then if they are inactive for say, 2 minutes you remove them from the database and on refresh it counts again. So it gets accurate statistics. Quote Link to comment https://forums.phpfreaks.com/topic/114468-retrieving-the-of-page-views/#findComment-588743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.