TAILIEUCHUNG - PHP and MySQL by Example- P15

Tham khảo tài liệu 'php and mysql by example- p15', 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ả | 4 input type password name password br 5 input type hidden name login br input type submit input type reset form body html end Explanation 1 This is a link to the protected page page 3 where special content can be read only if the visitor has typed in a valid username and password. 2 After the form has been submitted the PHP script page 2 will be executed. This page will determine whether or not the visitor is authorized to log in. 3 The visitor is asked to type in the username here. See Figures and . 4 This is where the user types in the password. 5 To submit information that is not entered by the visitor a hidden field is used and assigned the value login . Figure . Page 1 The file. Please purchase PDF Split-Merge on to remove this watermark. Figure . Page 1 The visitor fills out the form. Example . Code View Page 2 begin php 1 session_start User is logging in 2 if isset _POST login 3 if isset _POST username _POST username phpbee isset _POST password _POST password phpbee 4 _SESSION Authenticated 1 else 5 _SESSION Authenticated 0 Please purchase PDF Split-Merge on to remove this watermark. 6 session_write_close 7 header Location User is logging out 8 if isset _GET logout 9 session_destroy 10 header Location end Explanation 1 The session for this page starts here for page 2 . 2 If the user has filled out the login form in page 1 then the _P0ST login variable will be set and the statements in the if block will be executed. 3 If the username is set and has a value phpbee and the password is set and also has the value phpbee the statement in line 4 is executed. 4 The session variable is set to 1. The value of 1 will be used later to determine that the user is logged in. 5 If either a valid username or password were not entered the session variable is set to 0. A value of 0 will be used to determine that the user is .

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.