TAILIEUCHUNG - PHP and MySQL Web Development - P128

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 selectedIndex .value name account option value 0 selected Choose Account a option value action select-account account 10 option option value action select-account account 11 option option value 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 will be set to 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 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 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 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 .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.