This will count number of page views in a session. Simple, to add on the page just add the code on the top of the page and make sure it is before any html.
<?php
session_start();
if(isset($_SESSION['view']))
{
$_SESSION['view']=$_SESSION['view']+1;
}
else
{
$_SESSION['view']=1;
}
echo "Page Views Count On This Session:".$_SESSION['view'];
?>
kyrilkong
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.