Graphics Programs Reference
In-Depth Information
line 2, after the <%@LANGUAGE=”VBSCRIPT”%> and before the <% on line 3
and should look like this in the page:
<%@LANGUAGE=”VBSCRIPT”%>
<!--#include file=”Connections/nbfdb.asp” -->
<%
If it is included twice, delete the second instance and save the page. If not, in the
second line scroll down and find where it is located in the page (possibly around
line 36 or 37), select the code and drag it to the second line so that it looks like
the example above, then save the page and then repeat Steps 5 through 7.
8. On the browser toolbar, click the Back button to return to the database.asp page,
and then click another record, if available.
9. Close the browser, and then close all the pages.
Problem Solving: Copying and Pasting Code
As you use more advanced techniques, you will begin to work with code more frequently.
When you want the same functionality in two different places, a good technique is to copy
the code from one location and paste it in the other location. Not only does this technique
save you time, it also eliminates the chance of mistyping the code. It is also an acceptable
technique to copy and paste code from other code sources that are “available to the
public” such as sample code sites and topics that teach coding techniques. When copying
and pasting code from one source to another, paste the copied code into a style-free
text editor such as TextPad or Notepad and remove any formatting from the text before
pasting it into the code of your Web pages. This prevents hard-to-trace code errors that
arise from pasting formatted text in code.
Creating a Login Page to Protect Back-End Pages
Data collected from a Web site and stored in a database is often displayed in Web pages.
This convenience enables you to view the data from any computer that is connected to
the Internet. However, most businesses do not want the general public to have access to
this type of proprietary information. One way to restrict access to Web pages is to require
users to log in before they can view the pages. This protects the data from unauthorized
access. To add this functionality to pages, you must:
Create a table in the database that holds usernames and passwords. The team that
created the database included an administrative table with columns to collect user-
names and passwords. They also added one username (nextbest) and one password
(watchthetapes) in the table. You will use the username and password included in the
database to create and test the login.asp page.
Create a page that enables users to create accounts by entering a unique username
and password. Because only one member of the NextBest Fest staff is in charge of
monitoring and reporting the information collected in the database, you won't create
this page now. The team member will use the supplied username and password to log
in to protected pages. At another point, the team will create additional pages to enable
users to create unique usernames and passwords.
Search WWH ::




Custom Search