Hi,
I want to show page view in my php page, So could you explain how to solve this problem using session. Please reply as soon as possible.
How to use session in PHP?
3156
12-Mar-2012
Anonymous User
12-Mar-2012A PHP session variable is used to store information about, or change settings for a user session. Before you can store user information in your PHP session, you must first start up the session. session_start() function is used for start session into PHP page.
To resolve your problem you can try something like following code.
PHP Script Code:
<?php // Start Session session_start(); // check session value has been set or not if(isset ($_SESSION['PageViewUser'])) {// increment counter by 1 if session value is already set
$_SESSION['PageViewUser'] = $_SESSION['PageViewUser']+ 1 ;
} else {
// if session value not set, then value set by 1 in session variable
$_SESSION['PageViewUser'] = $_SESSION['PageViewUser']+1 ;
} ?>
For more details about Session or Session Variable in PHP visit this URL:
http://mindstick.com/Articles/660ef403-4dff-4ed7-8199-dc6daafb1ee7/?PHP%20Session