Use a session to create a page visit counter.
Source Code
session_start();
if (!isset($_SESSION['counter'])) {
$_SESSION['counter'] = 1;
} else {
$_SESSION['counter']++;
}
echo "You have visited this page ".$_SESSION['counter']." times.";
Use a session to create a page visit counter.
session_start();
if (!isset($_SESSION['counter'])) {
$_SESSION['counter'] = 1;
} else {
$_SESSION['counter']++;
}
echo "You have visited this page ".$_SESSION['counter']." times.";