Maxxus PRO SPK-23 Especificaciones Pagina 603

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 893
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 602
The code for the admin menu is shown in Listing 25.17.
LISTING 25.17 admin.phpThis Script Authenticates the Administrator and Lets Her
Access the admin Functions
<?
// include function files for this application
require_once(“book_sc_fns.php”);
session_start();
if ($username && $passwd)
// they have just tried logging in
{
if (login($username, $passwd))
{
// if they are in the database register the user id
$admin_user = $username;
session_register(“admin_user”);
}
else
{
// unsuccessful login
do_html_header(“Problem:”);
echo “You could not be logged in.
You must be logged in to view this page.<br>”;
do_html_url(“login.php”, “Login”);
do_html_footer();
exit;
}
}
do_html_header(“Administration”);
if (check_admin_user())
display_admin_menu();
else
echo “You are not authorized to enter the administration area.”;
do_html_footer();
?>
This code probably looks familiar; it is similar to a script from Chapter 24. After the adminis-
trator reaches this point, she can change her password or log outthis code is identical to the
code in Chapter 24, so we will not cover it here.
Building a Shopping Cart
C
HAPTER 25
25
B
UILDING A
SHOPPING CART
577
31 7842 CH25 3/6/01 3:39 PM Page 577
Vista de pagina 602
1 2 ... 598 599 600 601 602 603 604 605 606 607 608 ... 892 893

Comentarios a estos manuales

Sin comentarios