Session variables are set.


Forward to the next page

<?php
// Start the session
session_start();
?>
<!DOCTYPE html>
<html>
<body>

<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo 
"<h2>Session variables are set.</h2>";
?>
<br>
<a href="session_example_2.php">Forward to the next page</a><br>
<br>
<div style="background-color:#D3D3D3;">
    <?php highlight_file("session_example_1.php"); //outputs the source code of this file to the web page ?>
</div>
</body>
</html>