July 2000
Intermediate to advanced
492 pages
14h 53m
English
In this example, I will convert a simple CGI application to an ASP. I have written this application in two forms: one version in Perl and one in Visual Basic. Each version provides exactly the same functionality. It retrieves the user's name and programming language preference from a posted HTML form, then saves this information into a Microsoft Access database using ActiveX Data Objects. Figure 2.1 shows the CGI application in a browser window.

Figure B.1. The HTML interface for our CGI application
The HTML code for the form in Figure 2.1 is straightforward and is shown in Example 2.1.
Example B.1. HTML Source for the Sample CGI Application
<HTML> <HEAD> <TITLE>Sample Form</TITLE> </HEAD> <BODY bgcolor = #cccccc> <form action="XXXXXXXX SEE BELOW XXXXXXXXXX" method="POST"> <center> <h2>Welcome to the Programming Language Survey.</h2> <h3>Please enter your name and your programming language preference below.</h3> <TABLE WIDTH = 40%> <TR VALIGN = TOP> <TD WIDTH = 40%> <font face="Arial" size="+2">Name:</font> </td> <TD WIDTH = 60%> <input type="Text" name="UsrName" size="20" maxlength="80"><BR><BR> </TD> </tr> <TR VALIGN = TOP> <TD WIDTH = 40%> <font face="Arial" size="+2">Language:</font> </td> <TD WIDTH = 60%> <select name="ProgLang"> <option value="Perl">Perl <option value="Python">Python <option value="Visual Basic">Visual Basic </select> </TD> </tr> </TABLE> <BR><BR> ...
Read now
Unlock full access