cookie.show

subroutine cookie.show

***********************************************************************

* Demonstrate getting a cookie

***********************************************************************

*

* [00] 08Aug97 jr Initial Creation

* [01] 29Sep97 jr Remove w3HtmlComplete       

* [02] 20Oct97 jr Fix unassigned variable

include wbp w3Include

results = ""                        ;* cookie values

names   = "*"                       ;* cookie names

text    = ""                        ;* resulting HTML

call w3GetCookie(results, names)    ;* get cookies and translate to HTML

cnt = dcount(names, @AM)

for i = 1 to cnt

    text := "<DT>":names<i>:"</DT><DD>":results<i>:"</DD>"

next i                                                      

*  prepare subsitution strings for the header

subsitutions      = ""                 ;* [02]

subsitutions<1,1> = "##HEADLINE##"

subsitutions<1,2> = "Cookie Results"

subsitutions<2,1> = "##TITLE##"

subsitutions<2,2> = subsitutions<1,2>

*  set up the HTML page

call w3HTMLInit("","")              ;* use default system.headfoot.htm

call w3HTMLHeader("",subsitutions)

call w3HTMLInsert("cookie.show","##VALUES##":@VM:text)

call w3HTMLFooter("","")

return