tailieunhanh - PHP and MySQL Web Development - P133

PHP and MySQL Web Development - P133: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | 632 Chapter 28 Building a Mailing List Manager Listing Continued break case case show-my-lists display_items Subscribed Lists get_subscribed_lists get_email information show-archive unsubscribe break case change-password display_password_form break case store-change-password if change_password get_email HTTP_POST_VARS old_passwd HTTP_POST_VARS new_passwd HTTP_POST_VARS new_passwd2 echo p OK Password changed. p br br br br br br else echo p Sorry your password could not be changed. p display_password_form break The following actions may only be performed by an admin user if check_admin_user switch action case create-mail display_mail_form get_email break case create-list display_list_form get_email break Script Architecture 633 Listing Continued case store-list if store_list HTTP_SESSION_VARS admin_user HTTP_POST_VARS echo p New list added p br display_items All Lists get_all_lists information show-archive else echo p List could not be stored please try . again. p br br br br br break case send send HTTP_GET_VARS id HTTP_SESSION_VARS admin_user break case view-mail display_items Unsent Mail get_unsent_mail get_email preview-html preview-text send break Section 4 display footer do_html_footer You can see the four segments of the code clearly marked in this listing. In the preprocessing stage we set up the session and process any actions that need to be done before headers can be sent. In this case this includes logging in and out. In the header stage we set up the menu buttons that the user will see and display the appropriate headers using the do_html_header function from function just displays the header bar and menus so we won t go into it here. In the main section of the script we respond to the action the user has chosen. These actions are divided into three subsets actions that can be taken if not logged in actions 634 Chapter 28 Building a Mailing List Manager that can be taken by normal users and actions that can be taken by .

TỪ KHÓA LIÊN QUAN