Specifications

LISTING 28.2 Continued
// only these actions can be done if not logged in
switch ( $action )
{
case ‘new-account’ :
{
unset($normal_user);
unset($admin_user);
display_account_form($normal_user, $admin_user);
break;
}
case ‘store-account’ :
{
if (store_account($normal_user, $admin_user, $HTTP_POST_VARS))
$action = ‘’;
if(!check_logged_in())
display_login_form($action);
break;
}
case ‘log-in’ :
case ‘’:
{
if(!check_logged_in())
display_login_form($action);
break;
}
case ‘show-all-lists’ :
{
display_items(“All Lists”, get_all_lists(), ‘information’,
‘show-archive’,’’);
break;
}
case ‘show-archive’ :
{
display_items(“Archive For “.get_list_name($id),
get_archive($id), ‘view-html’, ‘view-text’, ‘’);
break;
}
case ‘information’ :
{
display_information($id);
break;
}
Building Practical PHP and MySQL Projects
P
ART V
666
34 7842 CH28 3/6/01 3:46 PM Page 666