This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Sessions

Get PHP Session Variable Values

Favorite color is .
Favorite animal is .

// check whether a session has started
<?php
session_start();
?>

// retrieve and display session variables
<?php
// Echo session variables that were set on previous page
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>";
echo "Favorite animal is " . $_SESSION["favanimal"] . ".";
?>