TAILIEUCHUNG - Professional Information Technology-Programming Book part 78

Tham khảo tài liệu 'professional information technology-programming book part 78', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Summary In this lesson you have learned how to set cookies from PHP and how to use PHP s session management to store values within a browser session. In the next lesson you will use these techniques to create a user authentication system using PHP. Lesson 15. User Authentication In this lesson you will build a user authentication process that can be used to protect certain pages of your website by using a password. Types of Authentication Chances are you have needed to log in to a website in the past so you should be aware of how the process of authentication works from a user s point of view. Generally speaking you are asked to enter a usernamesometimes your email addressand a password. There are actually two ways that a website can authenticate a user though using basic HTTP authentication and using session-based authentication. The following sections clarify the differences between these two methods. Basic HTTP Authentication Basic HTTP authentication can be performed by web server without having anything to do with PHP script. The example in this section assumes that you are using Apache web server for other web servers you should refer to your documentation. Authentication is usually done on a per-directory basis but can be set up to apply to individual files if required. By using an . htaccess file on your website you can specify for that directory a custom configuration that instructs the web server to require a login before proceeding. A typical set of configuration directives would look like this AuthType Basic AuthName Protected Website AuthUserF ile home yourname htpasswd require valid-user AuthUserFile points to the location of a password file that is created by using the htpasswd program. To create a new password file you would run a command like the following htpasswd c home yourname htpasswd chris New password Re-type new password Password Files You should use the c switch only when you want to create a new file. The htpasswd program does not ask .

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.