TAILIEUCHUNG - Teach Yourself E-Commerce Programming with ASP in 21 Days phần 6

và cá nhân hóa nội dung là quan trọng bởi vì bạn có thể sử dụng nó để tăng doanh số bán hàng. Để lấy một ví dụ đơn giản, bạn có thể muốn hiển thị quảng cáo khác nhau cho khách hàng khác nhau tùy thuộc vào lợi ích của họ. Nếu bạn đã ghi lại thực tế rằng một khách hàng nào đó thích nhìn | I 294 Day 13 Do not enable any form of authentication for the directory that contains . We are forcing Basic Authentication manually. Only Allow Anonymous Access should be enabled. Analysis The bulk of Listing lines 2-36 is devoted to decoding the username and password contained in the AUTHORIZATION header. In line 38 the AUTHORIZATION header is retrieved from the Request collection. If the AUTHORIZATION header contains no information the status code 401 is sent to the browser to force a password dialog. In line 45 the first six characters are stripped from the AUTHORIZATION header. These first six characters contain the plaintext characters BASIC which indicate the authorization scheme. We already know this so we get rid of the characters. In line 46 the AUTHORIZATION header is base64 decoded with the help of the Decode function. The decoded header will contain the username and password separated by a colon. In lines 47-49 the VBScript SPLIT function is used to extract the username and password from the header. In lines 51-56 the username and password are compared against the usernames and passwords contained in the userlist database table. If there are no matches the status code 401 is sent to the browser to force the password dialog box to appear. Otherwise the user can view the page. Summary In today s lesson you learned how to create a subscription Web site by implementing three different types of authentication. In the first section you learned how to use HTTP Authentication. You were given an overview of the three types of authentication supported by Internet Information Server and you learned how to enable authentication for a file directory or Web site. In the next section you learned how to use database authentication to password protect areas of your Web site. You created a database table named userlist that contains a list of usernames and passwords. You also created an Include file that checks usernames and passwords against the .

Đã 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.