note 109675 deleted from features.sessions by danbrown
| From: | danbrown@php.net | Date: | Fri, 10 Aug 2012 16:07:57 +0000 |
| Subject: | note 109675 deleted from features.sessions by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189995@lists.php.net to get a copy of this message | ||
Note Submitter: billskipton at orange dot net
----
The note submitted by idandaniels is flawed in that the code to display the number of page views is
inside the 'else'.
The corrected code is...
<?php
session_start();
if(isset($_SESSION['views']))
{
$_SESSION['views']++;
}
else
{
$_SESSION['views']=1;
}
echo "Views=". $_SESSION['views'];
?>