To start and record a session do:
<?php
session_start(); //starts the session
if(isset($_SESSION['views']))
$_SESSION['views'] = $_SESSION['views']+1;//if the session is started and the page is visited, add a count
else
$_SESSION['views'] = 1;//else keep it as it is
echo "Views=". $_SESSION['views'];//show the amount of page hits
?>
Sessions
Session support in PHP consists of a way to preserve certain data across subsequent accesses. This enables you to build more customized applications and increase the appeal of your web site. All information is in the Session reference section.
Danafazeli at hotmail dot co dot uk
28-Mar-2011 02:40
