I just wanted to share some old code I got lying around. It’s a session counter in PHP basically what it does is to increase a variable with one each time a page with the code is refreshed/visited. I even have a live example of it.
The code:
<?php // Start sessions! session_start(); // Is $_SESSION["count"] set? If yes, increase by one, if not set to one. isset($_SESSION["count"]) ? $_SESSION["count"]++ : $_SESSION["count"] = 1; echo "This page has been loaded: {$_SESSION["count"]} time(s)."; ?> <br /> Reload the page. It's a simple counter using sessions to keep the count.
Each time you refresh the page the the count will increase with one. Remove the cookie to start from 1 again.