You're using php - so look into $_SESSION.
One helpful hint: creating a session must be the
ABSOLUTELY first thing on a page,
<?php session_start() ?>
PHP 5 Sessions[
^]
There are other ways to do this (forms, AJAX, part of a URL target), but this is a "pure" answer to your question.