tailieunhanh - Secure PHP Building 50 Practical Applications Development phần 5

Ứng dụng đăng xuất có thể được liên kết đến từ bất kỳ ứng dụng PHP để cho phép người dùng đăng nhập bất cứ lúc nào. Sau khi đăng nhập phiên làm việc được loại bỏ. Có một hệ thống xác thực trung tâm như thế này sẽ giúp bạn giảm số lượng mã và bảo trì bạn cần | Chapter 10 Intranet Calendar Manager 339 Sets a member variable named fields which is a comma-separated list of calendar event table fields. Calls setEventID to set the given event ID to this object. loadEventlnfo This method sets all the attribute values for a given event as member variables to this class. This is how it works The given event ID is set to a member variable called to eid using setEventID . A statement to select all the event table fields for the given event ID is created in stmt. Using the DBI object this- dbi the stmt statement is run via the this- dbi- query method in DBI object. The result of the query is stored in the result variable. If there are more than zero rows in the result object each row is fetched in the row variable. For each message field of type text the data is stripped for embedded slash characters. Each message field data is stored as object variable using this- fieldname run-time variable. getEvents This method returns all the events that are to be shown to the given user on a given date. It works as follows The date string mm-dd-yyyy format passed to this method is used to find out these three formats of the given date the day of the week string the day of the month string and the month-day string. These formats are later used to check whether the given date is a weekly monthly or yearly repetitive date. A statement to select all the events that are to be viewed by the given user on the given date is prepared. This statement also selects the events viewable by the given user that fall on this day because of the repetitive event feature. The statement is stored in a variable named stmt. Using the DBI object this- dbi the stmt statement is run via the this- dbi- query method in the DBI object. The result of the query is stored in the result variable. If there are more than zero rows in the result object each row is fetched in the row variable. An associative array is prepared using each row s event ID and Event Title. The method

crossorigin="anonymous">
Đã 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.