TAILIEUCHUNG - PHP and MySQL Web Development - P140

PHP and MySQL Web Development - P140: 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. | Implementing Administrative Functions 667 case send send HTTP_GET_VARS id HTTP_SESSION_VARS admin_user break This calls the send function which you can find in the library. This is quite a long function. It is also the point at which we use the Mail_mime class. The code for our function is shown in Listing . Listing send Function from This Function Finally Sends Out a Newsletter create the message from the stored DB entries and files send test messages to the administrator or real messages to the whole list function send mailid admin_user if check_admin_user admin_user return false if info load_mail_info mailid echo Cannot load list information for message mailid return false subject info 0 listid info 1 status info 2 sent info 3 from_name Pyramid MLM from_address return@address query select email from sub_lists where listid listid result mysql_query query if result echo query return false else if mysql_num_rows result 0 echo There is nobody subscribed to list number listid return false 668 Chapter 28 Building a Mailing List Manager Listing Continued else include PEAR mail classes include include Mail instantiate MIME class and pass it the carriage return line feed character used on this system message new Mail_mime r n read in the text version of the newsletter textfilename archive listid mailid tfp fopen textfilename r text fread tfp filesize textfilename fclose tfp read in the HTML version of the newsletter htmlfilename archive listid mailid hfp fopen htmlfilename r html fread hfp filesize htmlfilename fclose hfp add HTML and text to the mimemail object message- setTXTBody text message- setHTMLBody html get the list of images that relate to this message query select path mimetype from images where mailid mailid if db_connect result mysql_query query if result echo p Unable to get image list from database. p return false num mysql_numrows result for i 0 i num i load each image from .

TỪ KHÓA LIÊN QUAN
Đã 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.