summary refs log tree commit diff stats
path: root/examples/cgiex.nim
blob: 857caa8eff750a77823740a0e60885eea89b161a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Test/show CGI module
import strtabs, cgi


#setTestData("name", "the andreas", "password", "rumpf\t\ttab")

var myData = readData()
validateData(myData, "name", "password")
writeContentType()

write(stdout, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n")
write(stdout, "<html><head><title>Test</title></head><body>\n")
writeln(stdout, "name: " & myData["name"])
writeln(stdout, "password: " & myData["password"])
writeln(stdout, "</body></html>")