PDA

View Full Version : count the number of times page reloads



amy
07-30-2008, 05:00 PM
hi,
how can i count the no of times a page reloads using php

djr33
07-30-2008, 05:30 PM
You can't check this directly; you can, however, store a variable on your server per IP address for how many times that page is loaded. [technically how many times the server processes the php-- in theory, it might not actually reach the end user]
Using sessions this wouldn't be difficult.

<?php session_start(); @$_SESSION['thispageidnumload']++; ?>

And do whatever you'd like with that variable.