Put this at the top of the page that first receives the data you want to save:
PHP Code:
<?php
session_start();
?>
Warning: there cannot be any spaces or blank lines before that opening php tag. In other words, it has to be at the very top of the file.
Then anywhere on the page, insert the data you want to save into the $_SESSION[] array:
PHP Code:
$_SESSION['someVarName'] = 'some data';
Whenever you are on another page and you want to add more data to the $_SESSION[] array or retrieve information from the array, at the top of the page put:
PHP Code:
<?php
session_start();
?>
and then you can freely access the array, e.g.
PHP Code:
echo $_SESSION['someVarName'];
Bookmarks