Below are the session variables that were set on the previous page:
Favorite color is .
Favorite animal is .
Previous Page
Delete Session Variables
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
echo "<h2>Below are the session variables that were set on the previous page:</h2>";
// Echo session variables that were set on previous page
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>";
echo "Favorite animal is " . $_SESSION["favanimal"] . ".";
?>
<br>
<a href="session_example_1.php">Previous Page</a><br>
<a href="session_example_delete.php">Delete Session Variables</a><br>
<br>
<div style="background-color:#D3D3D3;">
<?php highlight_file("session_example_2.php"); //outputs the source code of this file to the web page ?>
</div>
</body>
</html>