Jump to content

number of views


spode

Recommended Posts

this should work under most circumstances, you may have to look out for how you name pages

session_start();
$pageCount = 'page_'.$_SERVER['PHP_SELF'];
$parts = explode(".", $pageCount);
$pageCount = $parts[0];
$_SESSION[$pageCount]++;
echo "Number of pageviews this session: ".$_SESSION[$pageCount];

Link to comment
https://forums.phpfreaks.com/topic/60898-number-of-views/#findComment-303040
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.