Home Tutorial Php Examples Session Modification

 
 

Session Modification
Posted on: July 31, 2009 at 12:00 AM
In this example you will learn how to do the session modification in PHP.

Session Modification in PHP

Session modification can be done through incrementing the loop. As the counting of loop increments, the session be modified. 

First of all, begin the session with session_start(),  set the input of the session register. 

Run the counter. 

<?php
session_start();
session_register('count');
$count++;

if ($count==1) {
$mess= "one time!";
} else {
$mess="accessed this page $count times.";
}
?>
<html>
<head>
<title>Count</title>
</head>
<body>
<?php echo $mess; ?>
</body>
</html>

The Output:

The output will be modified session.

Related Tags for Session Modification:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.