Could somebody please direct me? Why the code is not working?
Let's say I have two scripts: mypage.php and mypage2.php.
mypage.php:
<?php // this starts the session
session_start();
// this sets variables in the session
$_SESSION['color']='red';
$_SESSION['size']='small';
$_SESSION['shape']='round';
print "Done";
?>
Works as expected, outputs "Done".
mypage2.php:
<?php // this starts the session
session_start();
// echo variable from the session, we set this on our other page
echo "Our color value is ".$_SESSION['color'];
echo "Our size value is ".$_SESSION['size'];
echo "Our shape value is ".$_SESSION['shape'];
?>
Doesn't output the values of the variables. Outputs just this:
"Our color value is Our size value is Our shape value is"
What am I doing wrong?
Thank you!