Session Example Page 3
The value (pulled from SESSION) for $var is 0GOTO Page 1
<?php
session_name("sperlt");
session_start(); //continue the session
include('../includes/header4.php');
echo('<h1>Session Example Page 3</h1>');
// pull the CURRENT value from the SESSION
$var = isset($_SESSION['var']) ? $_SESSION['var'] : 0;
// show the value pulled from the SESSION
echo("The value (pulled from SESSION) for \$var is $var <br><br>");
/*
* NOTE: No value has been assigned to $var other than what was pulled from a SESSION.
* The value was stored in the SESSION. That is the point of this exercise, namely to
* pass values from page to page.
*/
echo('<a href="page-one.php">GOTO Page 1</a>');
include('../includes/footer4.php');
?>
Last modified: March 25 2022
Line Count: 23