- Enabling Visitors to Create User Accounts
- Protecting Pages from Unauthenticated Visitors
- Testing Your New Pages
- Summary
Testing Your New Pages
Are you ready to view the fruits of your labor? Now that you have added all the required recordsets, forms, and behaviors to your pages, you are ready to test them. Although this section takes a brief look at the results of the chapter exercises, I highly recommend that you take some time to play around with the new pages you've developed. Understanding what your visitors will see when they attempt to log on can help you streamline your pages and make them as user-friendly as possible.
Exercise 8.12 Testing the User Account Pages
-
Close all of your pages and close UltraDev.
-
Open your Web browser and enter http://localhost/insideud4/default.asp in the address field.
-
As shown in Figure 8.21, you should now see your home page with the Create Account and Login links showing. Because you have not logged in, the Logout link is hidden.
-
Click the View Cart button. Because you are not an authenticated user, you are automatically redirected to the login.asp page.
-
Click the Create Account link on the left side of your page. The Create New User Account page now allows you to enter your information and create a user account.
- new_titles.asp
- new_titles_details.asp
- spotlight_items.asp
- spotlight_items_details.asp
- bargain_bin.asp
- bargain_bin_details.asp
-
In the Choose Username field, type testuser.
-
Click the Submit button. Because all the required fields have not been completed, a pop-up message, shown in Figure 8.22, lets you know that you need to finish filling out the form.
Figure 8.22. An alert informing you
that the required fields have not been filled in.
-
Click OK to close the pop-up box.
-
In the Choose Password field, type testuser. Because the field was designated as a password field, the actual text is replaced by asterisks.
-
Fill in the rest of the form as shown in Figure 8.23.
-
Click the Submit button. Having submitted a form that did not contain a username already in the database and with every field filled, you should now see the new user confirmation page shown in Figure 8.24.
-
Click the text that reads "click here" to login using the account you just created.
-
In the login form, type testuser for the username and testuser for the password. Click the Submit button. You should now see the validation.asp page letting you know that you successfully logged in.
-
Click the Logout button that is now visible on the left side of the page. As shown in Figure 8.25, UltraDev ends your session.
Figure 8.23. Complete the new user account
form using this information.
NOTE
Taking Care of Orphaned Pages As I mentioned earlier, when it comes to updating pages built using templates, UltraDev doesn't do a very good job of transferring recordsets to older pages. Because of this, it's probably a good idea to do a little cleanup before you test your pages.
Prior to this chapter, you have built six pages that rely on your nrfdefault template:
When you try to access each of these pages in your browser, you may receive an error. If you do, open your nrfdefault.dwt page and open the Server Behaviors panel. Right-click on the rsLogin recordset and choose Copy from the pop-up menu.
Next, open each of the six pages, right-click in the Server Behaviors panel and click Paste. Save each page and the problem should now be resolved.
Figure 8.24. Congratulations! You've added a new user to the database.
Figure 8.25. The logout page confirms that your session has ended.