Location: PHPKode > scripts > mSess PHP Class > msess-php-class/page2.php
<html>
<body>
<?php
 //Load Custom Session Library
 require ("mSess.inc");
 $GLOBALS['mSess'] = new mSess ("localhost", "username", "password", "database", "sessionVals");
 $GLOBALS['mSess']->open ();

 if (!isset ($GLOBALS['sessionVals']['myvar'])) {
   $GLOBALS['sessionVals']['myvar'] = "You did not start from page 1!";
 }
 ?>
<p>The value you set from the previous page is: <b><u><?php echo ($GLOBALS['sessionVals']['myvar']); ?></u></b></p>
<p><a href="page1.php?<?php echo ($GLOBALS['mSess']->getSID ()); ?>">Click here to go to page 1, and edit your value</a></p>
<p><a href="page3.php?<?php echo ($GLOBALS['mSess']->getSID ()); ?>">Click here to go to page 3, to destroy this session</a></p>
<?php
 //Close Custom Session Library
 $GLOBALS['mSess']->close ();
 ?>
<div style="border: 1px solid #C0C0C0;">
<h4>Errors:</h4>
<pre>
<?php
 //Display Errors
 echo (implode ("\n", $GLOBALS['mSess']->getErrs ()));
 ?>
</pre>
</div>
</body>
</html>
Return current item: mSess PHP Class