TAILIEUCHUNG - Phát triển web với PHP và MySQL - p 73

Building a Mailing List Manager CHAPTER 28 695 LISTING Continued $query = “insert into lists values (NULL, ‘$details[name]’, ‘$details[blurb]’)”; $result = mysql_query($query); return $result; } } This function performs a few validation checks before writing to the database: It checks that all the details were supplied, that the current user is an administrator, and that the list name is unique. If all goes well the list is added to the lists table in the database. Uploading a New Newsletter Finally we come to the main thrust of this application: uploading and sending newsletters to mailing lists. When an administrator clicks on the Create Mail button, it. | Building a Mailing List Manager 695 Chapter 28 Listing Continued query insert into lists values NULL details name details blurb result mysql_query query return result This function performs a few validation checks before writing to the database It checks that all the details were supplied that the current user is an administrator and that the list name is unique. If all goes well the list is added to the lists table in the database. Uploading a New Newsletter Finally we come to the main thrust of this application uploading and sending newsletters to mailing lists. When an administrator clicks on the Create Mail button it activates the create-mail action as follows case create-mail display_mail_form get_email break The administrator will see the form shown in Figure . Remember that for this application we are assuming that the administrator has created a newsletter offline in both HTML and text formats and will upload both versions before sending. We chose to implement it this way so that administrators can use their favorite software to create the newsletters. This makes the application more accessible. You can see that this form has a number of fields for an administrator to fill out. At the top is a drop-down box of mailing lists to choose from. The administrator must also fill in a subject for the newsletter this is the Subject line for the eventual email. All the other form fields are file upload fields which you can see from the Browse buttons next to them. In order to send a newsletter an administrator must list both the text and HTML versions of this newsletter although obviously you could change this to suit your needs . There are also a number of optional image fields where an administrator can upload any images that she has embedded in her HTML. Each of these files must be specified and uploaded separately. 28 Building a Mailing List Manager Building Practical PHP and MySQL Projects 696 Part V Figure The Create Mail option gives the .

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.