he manner in which Active Server Pages operates can be illustrated very simply by using VBScript functions to display the system date and time. It is assumed that you have basic familiarity with the Visual Basic language, of which VBScript is a subset. Even if you do not know Visual Basic, you should be able to follow the examples and learn VBScript along the way.





By passing the date parameter 0 (short) or 1 (long), the function returns the appropriately formatted date. By passing the time parameter 4 (short) or 0 (long), the function returns the appropriately formatted time.





The ASP Response Object supplies several useful properties and methods for producing server output destined for a Web page. For example, we have used the Response.Write() method to display server data and to write HTML code to a page. As we proceed through this tutorial, other features of the Response Object are introduced as needed.





As described on the previous page, the ServerVariables Collection within the Request Object is an array of values identified by names. As such, this collection is what is traditionally called an "associative array," meaning a data structure of values indexed by names.





The notion is that the user can try again to enter the correct account and password. However, when the logon.asp page is redisplayed, there is no indication to the user what has happened. We can help the user understand the situation better by displaying a message indicating that an incorrect password has been entered.





Throughout this tutorial we will be working with information stored in databases. For our purposes we will use the Microsoft Access Database as our database management system. It is easy to learn and use and is readily available to most people with a desktop computer.





All interactions with the database take place on the logon.asp page. This is were we check for valid accounts and passwords.





The ASP Recordset Object contains the properties and methods necessary to extract data from a database table and to make that set of records available to a script. Normally, you need to create as many Recordset Objects as there are tables being accessed. In the present example, we are accessing the single Accounts table from Database.mdb. Therefore, we need a single Recordset Object for our...





n our example logon script we need to look through the recordset of accounts and passwords to see if the visitor entered a matching combination of values. Thus, we need to set up a program iteration, or loop, to advance the recordset cursor from one record to the next, looking for matches to the account and password entered on the form.





Most database management systems provide easier and faster ways of extracting information from their tables. The common denominator of these methods is SQL, the Structured Query Language built into these systems. SQL is a full-service language for maintaining information in a database and worthy of study in its own right. However, we'll pick and choose the features as we need them rather than...





Rather than retrieving the entire table of accounts and passwords and looking through them one at a time, we'll use an SQL SELECT statement to attempt to retrieve a matching record. That is, we'll look for a record in which the Account value from the form matches the Account value in the table, and where the Password value from the form matches the Password value in the table. We'll compose an SQL...





he process for counting visitors to a Web site is problematic. The difficulty is in deciding just Who is a visitor? or What is a visitor? or When is a visitor? On the surface it might sound easy. Simply tally a visitor whenever the person accesses a page at your site. However, this doesn't work because you end up over-counting the person who wanders from page to page.





Among the various ASP built-in objects, we've had occasion to discuss and use the Server Object (to create instances of other objects), the Response Object (to output script processing to a Web page), the Request Object (to handle script input from forms and query strings), and the Session Object (to server as a global repository for user sessions). As we proceed through this tutorial there will...





Perl is an acronym, short for Practical Extraction and Report Language. It was designed by Larry Wall as a tool for writing programs in the UNIX environment and is continually being updated and maintained by him. For its many fans, Perl provides the best of several worlds





Using your favorite editor, type the previous program and save it in a file called program1_1. Tell the system that this file contains executable statements. To do this in the UNIX environment, enter the command $ chmod +x program1_1 Run the program by entering the command $ program1_1













