require "Sessions/mysql_session_handler.php"; // put in /usr/share/php
session_start();
if ( $action = "logout" )
{
// Someone hit the logout button. Destroy the session.
print "Session destroyed.
";
session_destroy();
// The session associative array is still hanging around,
// however, it is no longer attached to the session,
// so we can just unset it.
unset ($session);
}
else if ( $username )
{
// The script was given a username, so let's create a session.
$session['username'] = $username;
// This line is to appease our Perl counterpart.
$session['_session_id'] = session_id();
session_register('session');
}
if ( $user = $session['username'] )
{
// There is a session defined already. Let's say hi.
print "Hello $user!
";
print "Logout";
}
else
{
// This is the first time we accessed the script.
// Print out a text box
print "