Specifications
FIGURE 25.14
The show_book.php script produces different output for an administrative user.
The administrator has access to two new options on this page: Edit Item and Admin Menu. You
will also notice that we don’t see the shopping cart in the upper-right corner—instead, we have
a Log Out button.
The code for this is all there, back in Listing 25.8, as follows:
if( check_admin_user() )
{
display_button(“edit_book_form.php?isbn=$isbn”, “edit-item”, “Edit Item”);
display_button(“admin.php”, “admin-menu”, “Admin Menu”);
display_button($target, “continue”, “Continue”);
}
If you look back at the show_cat.php script, you will see that it also has these options built in
to it.
If the administrator clicks the Edit Item button, she will go to the
edit_book_form.php script.
The output of this script is shown in Figure 25.15.
Building Practical PHP and MySQL Projects
P
ART V
580
31 7842 CH25 3/6/01 3:39 PM Page 580










