TAILIEUCHUNG - Web Publishing with PHP and FileMaker 9- P10

Web Publishing with PHP and FileMaker 9- P10:On the other hand, it would drive me nuts if you bought this book only to discover that it didn’t address your needs. In the spirit of customer satisfaction, please read the following introduction to get a sense of where I’m coming from, and whether you might get some good use out of this book. | Deleting Records 125 else page_content p Action cancelled. Record was not deleted. p page_content . p a href Return to list view a p html head title 07_04 title head body php echo page_content body html As usual the page begins with the standard information required to create the FileMaker connection object. Then I use the getRecordByld to grab a reference to the record that the user is considering deleting. record fm- getRecordById Product _REQUEST recid Do you notice something new in the preceding line I am pulling the recid out of an array called the REQUEST array. The REQUEST array is very similar to the GET and POST arrays except that it will exist if the page was accessed with either GET or POST. As you will see shortly this page can be accessed from two different pages the product list page and itself and each uses a different request method. So because we don t necessarily know if this page will be called with GET or POST REQUEST comes in handy. As an alternative I could have first checked GET for the recid and if I didn t find it check POST. 7 NOTE Note that I am assuming that the delete confirmation page is being requested with a value assigned to recid which is safe to assume if the page is called from the expected places. However the possibility exists that the user could browse directly to this page by typing the uniform resource locator URL into his or her browser. If the user did so a couple of errors would occur one from PHP for trying to use an array element that does not exist but more important one from FileMaker because the getRecordByld method requires a value. This situation is covered in Appendix C Error Handling and Prevention so I left it out of this example. Now that I have a reference to the record that the user is considering deleting I need to check to see what action the user has requested if any if isset S_POST action 126 CHAPTER 7 Altering FileMaker Data Because we are still talking about the first page load the POST array

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.