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

Implementing Authentication with PHP and MySQL CHAPTER 14 315 The code in Listing acts in a very similar way to the previous listings in this chapter. If the user has not yet provided authentication information, it will be requested. If she has provided incorrect information, she is given a rejection message. If she provides a matching namepassword pair, she is presented with the contents of the page. The user will see an interface somewhat different from the previous listings. We are not providing an HTML form for login information. The user’s browser will present her with a dialog box. Some people. | Implementing Authentication with PHP and MySQL 315 Chapter 14 The code in Listing acts in a very similar way to the previous listings in this chapter. If the user has not yet provided authentication information it will be requested. If she has provided incorrect information she is given a rejection message. If she provides a matching namepassword pair she is presented with the contents of the page. The user will see an interface somewhat different from the previous listings. We are not providing an HTML form for login information. The user s browser will present her with a dialog box. Some people see this as an improvement others would prefer to have complete control over the visual aspects of the interface. The login dialog box that Internet Explorer provides is shown in Figure . Figure The user s browser is responsible for the appearance of the dialog box when using HTTP authentication. Because the authentication is being assisted by features built in to the browser the browsers choose to exercise some discretion in how failed authorization attempts are handled. Internet Explorer lets the user try to authenticate three times before displaying the rejection page. Netscape Navigator will let the user try an unlimited number of times popping up a dialog box to ask Authorization failed. Retry between attempts. Netscape only displays the rejection page if the user clicks Cancel. As with the code given in Listing and we could include this code in pages we wanted to protect or automatically prepend it to every file in a directory. 14 Implementing Authentication 316 E-commerce and Security Part III Using Basic Authentication with Apache s .htaccess Files We can achieve very similar results to the previous script without writing a PHP script. The Apache Web server contains a number of different authentication modules that can be used to decide the validity of data entered by a user. The easiest to use is mod_auth which compares name-password pairs

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.