In this lab we will briefly explore the idea of how a Web page can serve as a front-end to allow the user to make entries and lookups in an online database. But first…
If you have not yet published your personal Web page by uploading it to Arches, please do so now. I have left enough time for you to take some care and make it a true expression of your personality, so please don't be satisfied with just a sloppy job to satisfy the requirement. This is your Web presence – make it reflect how you want to present yourself to the world! Don't forget that we have a digital camera to take a photo of you if you wish, and we'll be glad to help you upload your photo to Arches so that it can be part of your Web page.
IMPORTANT PRIVACY WARNING: In this exercise you will be entering data into a real live Web database whose contents are publicly accessible on the Internet. Do not enter your E-mail address into this form unless you are willing to be contacted!
Launch your Web browser and open the page
http://www.cs.uga.edu/~dme/csci1100/insert.html
Use the File/Save Page menu item to save this file onto a diskette so that you can work with it. As always, if you don't have a diskette you can use a folder with your name on the I: drive, but remember that these can be erased by anyone.
Launch Notepad and open the file you have just saved. There are two new elements which make this page interact with a database:
You will also notice some SELECT and OPTION tags. These are new tags which create drop-down lists. For example, the lines
<select
name=class>
<option value=1>Freshman
specify that this option will show up as Freshman in the drop-down list, but the value1 will be sent to the server if this option is selected. Note that a </SELECT> tag follows the last <OPTION> tag.
Edit the file to jazz it up a bit, as follows:
You can refer to "Dr. Dan's Quickie HTML guide" or the Netscape HTML reference page
http://developer.netscape.com/docs/manuals/htmlguid/index.htm
if you have forgotten how to use the appropriate HTML tags.
OK, let's see if this works. Type in your name, or a fake name if you don't want to reveal your interests. Fill out the rest of the form and click Submit. You should see an acknowledgement that your information has been entered.
Now point your web browser at the selection page,
http://www.cs.uga.edu/~dme/csci1100/select.html
Again, please jazz this page up along the lines suggested for the input page.
There is a new tag type in this page: the hidden input tag. These values are not shown on the page, but they are passed back to the server program, and control how the reply is formatted. This particular server program recognizes the following hidden tags:
Try this page out, by searching for the interest you just entered. You should see yourself, and possibly others! To see the entire database, enter any in the interest field.
Now customize this program by altering the hidden tags to create your own personalized text (but see below if you are tempted to add new HTML to the header text!) There is no tableColor value, so put one in. I like light blue.
It is possible to add new HTML to the page by putting it into the hidden headerText tag. However, you cannot use the "<" and ">" characters in the headerText string, as this will confuse Netscape big time. Instead, you must use the special characters
This looks horrible, but just remember that lt stands for "less than" and gt for "greater than." To see an example, open the page
http://www.cs.uga.edu/~dme/cs101/select2.html
You'll see some scary-looking stuff in the headerText hidden tag. But if you translate the special characters and put in some line breaks, it translates to
<table>
<tr>
<td><font size=+2
color=blue>Welcome to my interactive database! Here are some students
who share your interests!
<td><img
src=http://www.arches.uga.edu/~drdan/koala2.gif>
</table>
<p>
This creates a table with two entries, a text string and an image. Note that we can use an HTTP: address to specify an image on a different server. Try it out!
A couple of cautionary notes:
If you are feeling adventurous, try this technique to put some cool stuff on your results page!