PHP and MySQL Web Development - P135

PHP and MySQL Web Development - P135: 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. | 642 Chapter 28 Building a Mailing List Manager Now that we have logged in a user we can proceed to the user functions. Implementing User Functions There are five things we want our users to be able to do after they have logged in Look at the lists available for subscription Subscribe and unsubscribe from lists Change the way their accounts are set up Change their passwords Log out You can see most of these options in Figure will now look at the implementation of each of these options. Viewing Lists We will implement a number of options for viewing available lists and list details. In Figure you can see two of these options Show My Lists which will retrieve the lists this user is subscribed to and Show Other Lists which will retrieve the lists the user is not subscribed to. If you look back at Figure you will see that we have another option Show All Lists which will retrieve all the available mailing lists on the system. For the system to be truly scalable we should add paging functionality to display say 10 results per page .We have not done this here for brevity. These three menu options activate the show-my-lists show-other-lists and show-all-lists actions respectively. As you have probably realized all these actions work quite similarly. The code for these three actions is as follows case show-all-lists display_items All Lists get_all_lists information show-archive break case show-other-lists display_items Unsubscribed Lists get_unsubscribed_lists get_email information show-archive subscribe break Implementing User Functions 643 case case show-my-lists display_items Subscribed Lists get_subscribed_lists get_email information show-archive unsubscribe break As you can see all these actions call the display_items function from the library but they each call it with different all also use the get_email function we mentioned earlier to get the appropriate email address for this user. To see what this function does look

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.