Phát triển web với PHP và MySQL - p 66

Building a Web-Based Email Service CHAPTER 27 625 LISTING Continued store_account_settings($auth_user, $HTTP_POST_VARS); break; } case ‘select-account’ : { // if have chosen a valid account, store it as a session variable if($account&&account_exists($auth_user, $account)) { $selected_account = $account; session_register(‘selected_account’); } } } // set the buttons that will be on the tool bar $buttons[0] = ‘view-mailbox’; $buttons[1] = ‘new-message’; $buttons[2] = ‘account-setup’; //only offer a log out button if logged in if(check_auth_user()) { $buttons[4] = ‘log-out’; } //***************************************************************************** // Stage 2: headers // Send the HTML headers and menu bar appropriate to current action //***************************************************************************** if($action) { // display header with application name and. | Building a Web-Based Email Service 625 Chapter 27 Listing Continued store_account_settings auth_user HTTP_POST_VARS break case select-account if have chosen a valid account store it as a session variable if account account_exists auth_user account selected_account account session_register selected_account set the buttons that will be on the tool bar buttons 0 view-mailbox buttons 1 new-message buttons 2 account-setup only offer a log out button if logged in if check_auth_user buttons 4 log-out Stage 2 headers Send the HTML headers and menu bar appropriate to current action if action display header with application name and description of page or action do_html_header auth_user Warm Mail - . format_action action selected_account else display header with just application name do_html_header auth_user Warm Mail selected_account display_toolbar buttons Stage 3 body Depending on action show appropriate main body content 27 Building a Web-Based Email Service Building Practical PHP and MySQL Projects 626 Part V Listing Continued display any text generated by functions called before header echo status if check_auth_user echo P You need to log in if action action log-out echo to go to .format_action action echo . br br display_login_form action else switch action if we have chosen to setup a new account or have just added or deleted an account show account setup page case store-settings case account-setup case delete-account display_account_setup auth_user break case send-message if send_message to cc subject message echo p Message sent. br br br br br br else echo p Could not send message. br br br br br br break case delete delete_message auth_user selected_account messageid note deliberately no break - we will continue to the next case case select-account case view-mailbox if mailbox just chosen or view mailbox chosen show mailbox display_list auth_user selected_account break case show-headers case hide-headers Building a Web-Based Email Service 627 Chapter 27

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.