Sessions would definitely be of some good in this situation, although there might be other alternatives. I use session vars to handle this in situations where a session needs run anyway, (like shopping carts...)
I'd really recommend you read the manual and what it has to say about session handling. The link will take you to the manual; sorry, I'm on a terribly slow link ATM, and can't spare the BW to post the exact link. Put "session_start" in the search engine (the one at php.net) and go up a level from there, I expect.
For a short overview:
session_start();
// begins the session, *must be on each page* that will
// use session variables; like setcookie(), it must be called
// prior to any browser output
$_SESSION['name']="Bob";
// the name "Bob" is now stored in the $_SESSION
// superglobal array ...
echo $_SESSION['name']; // prints "Bob", use on any page...
$fruit=array("banana", "apple", "orange");
$_SESSION['fruit']=$fruit;
echo $_SESSION['fruit'][2]; // prints "orange"
unset $_SESSION['fruit'][2]; // array now has two elements,
// 0 => "banana", 1 => "apple"
session_destroy(); // all session vars are gone...
Use in an HTML form:
<form action=somescript.php method=post>
<input type=text name=username value=<? echo $_SESSION['username'] ?>>
somescript.php:
session_start();
$_SESSION['username']=trim($_POST['username']);
Now, if the user reloads the form page, PHP will print the "username" variable in the correct form field...
HTH,