pass variable to session php code example
Example 1: create session in php
<?php
// Start the session
session_start();
// Set session variables
$_SESSION["color"]= "blue";
$_SESSION["animal"]= "dog";
echo "The session variable are set up.";
?>
Example 2: send value from one page to another in php
//On page 1
$_SESSION['varname'] = $var_value;
//On page 2
$var_value = $_SESSION['varname'];