Write an Active Server Page (partscookie.asp) that displays two forms. The first contains one text box input, two drop- down lists and a submit button Add to Cookie. The user enters a number in the text box and selects a color (Red, Green or Blue) and size (Small, Medium or Large) from the drop-down lists. When the form is submitted, the ASP requests itself and POSTs the form contents. The ASP then stores the number, color and size in a cookie named Parts. This cookie can contain multiple values. That is, the user can fill out the first form and submit it multiple times. Each time the form is submitted, a value is added to the Parts cookie. The second form contains a submit button Display Cookie. When the form is submitted, the ASP requests itself and passes a parameter (Display). The ASP

What will be an ideal response?


```

1 <% @LANGUAGE=VBScript %>

2 <% Option Explicit %>

3

4 <% ' partscookie.asp %>

5

6 <% ' If the user has made an entry

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

8 Dim count, s, part

9

10 count = Request.Cookies( "Parts" ).count

11 part = Request( "PartNumber" ) & "|" & Request( "Color" ) & "|" _

12 & Request( "Size" )

13 s = CStr( count + 1 )

14 Response.Cookies( "Parts" )( "part" & s ) = part

15 Response.Cookies( "Parts" ).expires = Date() + 2

16 End If

17 %>

18

19

20

21

22

23 Parts Cookie

24

25

26

27

28

Parts Cookie




29

30 <% If Request( "entry" ) = "true" Then

31 %>

32 Added part to cookie.

33


34 <% End If %>

35

36


37

38
Computer Science & Information Technology

You might also like to view...

using namespace std; const double Pi = 3.141592654;

What will be an ideal response?

Computer Science & Information Technology

The __________ is the core of the operating system that communicates directly with the hardware.

a. kernel b. IOCS c. file system d. BIOS

Computer Science & Information Technology

The visibility of these modifiers increases in this order:

a. private, protected, none (if no modifier is used), and public. b. private, none (if no modifier is used), protected, and public. c. none (if no modifier is used), private, protected, and public. d. none (if no modifier is used), protected, private, and public.

Computer Science & Information Technology

A _____________ is a word, phrase, symbol, or design that identifies and distinguishes the source of the goods of one party from those of others

a. copyright b. trademark c. domain name d. Web host

Computer Science & Information Technology