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

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

PHP and MySQL Web Development - P129: 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. | 612 Chapter 27 Building a Web-Based Email Service case show-headers case hide-headers case view-message if we have just picked a message from the list or were looking at a message and chose to hide or view headers load a message fullheaders action show-headers display_message HTTP_SESSION_VARS auth_user HTTP_SESSION_VARS selected_account messageid fullheaders break You ll notice that we re checking the value of the action being equal to show-headers . In this case it will be false and fullheaders will be set equal to false.We ll look at the show-headers action in a moment. The line fullheaders action show-headers could have been more verbosely but perhaps more clearly written as if action show-headers fullheaders true else fullheaders false Next we call the display_message function. Most of this function outputs plain HTML so we will not go through it here. It calls the retrieve_message function to get the appropriate message from the mailbox message retrieve_message auth_user accountid messageid fullheaders The retrieve_message function is in the mail_fns.php library.You can see the code for it in Listing 27.10. Listing 27.10 retrieve_message Function from mail_fns.php This Function Retrieves One Specific Message from a Mailbox function retrieve_message auth_user accountid messageid fullheaders message array if auth_user messageid accountid return false imap open_mailbox auth_user accountid if imap return false Reading Mail 613 Listing 27.10 Continued header imap_header imap messageid if header return false message body imap_body imap messageid if message body message body This message has no body n n n n n n if fullheaders message fullheaders imap_fetchheader imap messageid else message fullheaders message subject header- subject message fromaddress header- fromaddress message toaddress header- toaddress message ccaddress header- ccaddress message date header- date note we can get more detailed information by using from and to rather than fromaddress and .