Đang chuẩn bị liên kết để tải về tài liệu:
PHP and MySQL Web Development - P128

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

PHP and MySQL Web Development - P128: 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. | Reading Mail 607 select onchange window.location this.options selectedIndex .value name account option value 0 selected Choose Account a option value index.php action select-account account 10 mail.domain.com option option value index.php action select-account account 11 mail.server.com option option value index.php action select-account account 9 localhost option select Most of this code is just an HTML select element but it also includes a little JavaScript. In the same way that PHP can generate HTML it can also be used to generate clientside scripts. Whenever a change event happens to this element JavaScript will set window. location to the value of the option. If your user selects the first option in the select window.location will be set to index.php action select-account account 10 . This will result in this URL being loaded. Obviously if the user has a browser that does not support JavaScript or has JavaScript disabled this code will have no effect. The display_account_select function from output_fns.php is used to get the available account list and display the SELECT. It also uses the get_account_list function we discussed previously. Choosing one of the options in the SELECT activates the select_account event. If you look at the URL in Figure 27.5 you can see this appended to the end of the URL along with the account ID of the chosen account. This has two effects. First in the preprocessing stage of index.php the chosen account will be stored in the session variable selected_account as follows case select-account if have chosen a valid account store it as a session variable if account account_exists HTTP_SESSION_VARS auth_user account HTTP_SESSION_VARS selected_account account Second when the body stage of the script is executed the following code will be executed case select-account case view-mailbox 608 Chapter 27 Building a Web-Based Email Service if mailbox just chosen or view mailbox chosen show mailbox display_list HTTP_SESSION_VARS auth_user .

Đã 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.