TAILIEUCHUNG - Beginning PHP6, Apache, MySQL Web Development- P14
Beginning PHP6, Apache, MySQL Web Development- P14:Welcome to Beginning PHP6, Apache, MySQL Web Development , your new trusty resource for assistance in creating your own dynamic web sites. There are a lot of technologies available that can be used to deliver great web sites, and we ’ re glad you chose the Apache/MySQL/PHP (sometimes referred to simply as AMP) approach. You may or may not have had a taste of these three components in the past, but either way we ’ re confident that you will be impressed with the power that lies within them | Chapter 12 User Logins Profiles and Personalization _SESSION username username _SESSION logged 1 header Refresh 5 URL . redirect echo p You will be redirected to your original page request. p echo p If your browser doesn t redirect you properly . automatically a href . redirect . click here a . p die else set these explicitly just to make sure _SESSION username _SESSION logged 0 error p strong You have supplied an invalid username and or . password strong Please a href click here . to register a if you have not done so already. p html head title Login title head body php if isset error echo error form action method post table tr td Username td td input type text name username maxlength 20 size 20 value php echo username td tr tr td Password td td input type password name password maxlength 20 size 20 value php echo password td tr tr td td td input type hidden name redirect value php echo redirect input type submit name submit value Login tr table form body html 361 Part II Comic Book Fan Site 4. 5. Save the file as . Navigate to the page you created. Because you haven t logged in yet the file you included redirects you to the page as shown in Figure 12-3. Figure 12-3 6. Try using incorrect login information so you can see how the page works. You will see a screen similar to the one shown in Figure 12-4. 362 Chapter 12 User Logins Profiles and Personalization Figure 12-4 7. Now input the correct information wroxbooks for the username and aregreat for the password. You are redirected to the page you originally requested because you supplied the correct information. You will see a screen similar to Figure 12-5. .
đang nạp các trang xem trước