
Originally Posted by
thetestingsite
@ragana:
That would only work for the current visitor and every time a new visitor went to the site would get the following (the first time):
You missed rangana
Anyway, yes, you're right.
PHP Code:
<?php
session_start();
if(isset($_SESSION['views']))
$_SESSION['views']+=1; // store session data
else
$_SESSION['views']=1;
?>
We've got a number of jobs which is viewed
<?php if ($_SESSION['views']==1) echo $_SESSION['views'].' time'; else echo $_SESSION['views'].' times';?>
Bookmarks