%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% 'This is the creation of the shopping cart 'We begin with some constants CONST CART_COLUMNS = 4 'This is the number of column in our cart array CONST CART_ROWS = 3 'This is the default number of rows in our cart array CONST ITEMID = 1 'This is the first column in the cart array CONST ITEMNAME = 2 'This is the second column in the cart array CONST ITEMPRICE = 3 'This is the third column in the cart array CONST ITEMQUANTITY = 4 'This is the last column in the cart array Dim cartMaxUsed 'Create the shopp-ing cart Dim cartArray() 'The array is empty and has no size ReDim cartArray(CART_COLUMNS, CART_ROWS) 'Only the second demension can change after creation, this order lets us expand the rows later rowsUsed = 0 'The number of rows currently used Session("cartArray") = cartArray Session("cartRows") = CART_ROWS Session("rowsUsed") = rowsUsed 'stores the cart to the sesion so it isn't lost when the user changes pages %> <% Dim idSession idSession = session.SessionID Dim firstName Dim lastName 'firstName = "Kent" 'lastName = "Rice" 'This sets a cookie to the client response.Cookies("acmeClient") = firstName & " " & lastName response.Cookies("acmeClient").expires = date + 366.25 'This gets a cookie and uses it Dim cookieValue cookieValue = request.Cookies("acmeClient") if cookieValue <> " " then Dim greeting greeting = " back " &cookieValue end if %>
Welcome<%= greeting %> to the ACME web site.
Strategy of the month!
Recipe of the month!