File: helloweb2.k

package info (click to toggle)
kaya 0.4.2-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,448 kB
  • ctags: 1,694
  • sloc: cpp: 9,536; haskell: 7,461; sh: 3,013; yacc: 910; makefile: 816; perl: 90
file content (35 lines) | stat: -rw-r--r-- 501 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cgi helloweb2;

import CGI;

Void PreContent()
{
    content("<html><head><title>Hello!</title>
             </head><body>");
}

Void Default()
{
    helloForm();
}

Void helloForm()
{
    content(formHandler(OnHello,0)+
	    "What is your name? "+
	    textBox("name")+
	    submit("Say Hello")+
	    closeForm());
}

Void OnHello(Int dummy)
{
    name = incomingValue("name",DataPost);
    content("<p>Hello "+name+"!</p>");
    helloForm();
}

Void PostContent()
{
    content("</body></html>");
}