Graphics Programs Reference
In-Depth Information
Creating Database-Driven Pages Using Access
and ASP
Adding database functionality to a Web site can be quite complex. Just as it is a good
idea to make a plan prior to creating a Web site, it is also a good idea to plan the
database-driven portion of the site in advance. Gage created a site plan for the new por-
tion of the NextBest Fest site.
Based on Gage's plan, the NextBest Fest technical team will create a database to store
the information collected from the form in the contact.html page. You will modify the
form to work with the database. You'll create the pages that you will need for the new
portion of the site: thankyou.html, access_denied.html, database.asp, database_details.
asp, and login.asp. You'll upload the database fi le provided by the technical team to the
remote server, and then you'll connect the site to the database. Next, you'll add server
behaviors to the pages you created so that the form data can be sent to and stored in the
database and so that the database.asp and database_details.asp pages display the infor-
mation stored in the database. Finally, you'll create a login.asp page and add code to the
back-end pages to prevent unauthorized users from viewing the content of those pages.
When the database-driven pages are complete, the information received from users
who completed the form in the contact.html page will be stored in a database that only
authorized users can access.
Creating Database-Driven Pages for a Windows Server
• Create the Web pages you need.
• Upload to your remote server a database file in which to store data.
• Add server behaviors to connect the site to the database.
• Add server behaviors to store submitted data in the database and to view the data col-
lected in the database from within designated Web pages.
• Create a login page.
• Add code to the back-end pages to prevent unauthorized users from viewing the con-
tent of those pages.
Modifying the Form
Before you create the database-driven pages of the NextBest Fest site, you'll modify the
form in the contact.html page to work with the database that you will place on your
remote server. You will delete the list box with the band names from the form, and then
create a series of check boxes to collect this same information. You are replacing the list
box with the check boxes to keep things simpler because the list box, as the database
storage element, requires more steps and custom scripts to process data.
To modify the form in the contact.html page:
1. Reset the workspace to the Designer layout, open the NextBest Fest site you
modified in Tutorial 8, and then open the contact.html page in Design view.
2. In the right column near the bottom of the form, select the list box, and then
press the Delete key. The list box is removed from the form.
3. In the same location as the deleted list box, insert a checkbox group . The
Checkbox Group dialog box opens.
4. Type band_list in the Name box, and then add the following labels and val-
ues: Bon-Journey / bj , Revolver / revolv , More Exquisite Less Dead / meld ,
Ramones Mania / rm , and One / one .
Search WWH ::




Custom Search