Create an ASP application that allows the user to customize a Web page. Store the user’s name and preferences in a text file. The application should consist of three ASP files: one that asks the user to login and reads from the text file to determine if the user is known. If the user is not known, a second ASP file is loaded asking the user to choose their preference for foreground color, background color and image. Write the new user’s name and preferences to the text file. Next, display the page customized to this user using the user’s preferences that are stored in the text file. If the user is known at login, the normal page should be displayed.

What will be an ideal response?

The first table is customize.asp, the second table is title.asp and the third table is login.asp.



```

1 <%

2 ' Exercise 25.8 Solution

3 Option Explicit

4

5 ' If they have made a customization submission ...

6 If Request("entry") = "true" Then

7

8 Dim fso, tso, path, s

9

10 ' Create a file system object to write the new user's preferences

11 Set fso = CreateObject( "Scripting.FileSystemObject" )

12 path = "c:InetpubwwwrootSolutionsex25_08users.txt"

13 If Not fso.FileExists( path ) Then

14 Call fso.CreateTextFile( path )

15 End If

16

17 ' Open the file in append mode

18 Set tso = fso.OpenTextFile( path, 8 )

19

20 ' Create the new user record in string s

21 ' We have chosen '|' to be the record delimiter in the file

22 ' and '[' to be the field delimiter in a record

23 s = Session( "newuser" ) & "["

24 s = s & Session( "newpwd" ) & "["

25 s = s & Request( "foreground" ) & "["

26 s = s & Request( "background" ) & "["

27 s = s & "/images/"

28 s = s & Request( "im

Computer Science & Information Technology

You might also like to view...

A(n) ____ is one that occurs at regular intervals, ranging typically from one to three years between reviews.

A. risk-based review B. cost-based review C. asset-based review D. time-based review

Computer Science & Information Technology

The ISO/IEC character set is an international numbering system for referencing characters from virtually any language.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology