cgi helloweb2;
import Regex;
import CGI;
Void PreContent()
{
content("
Hello!
");
}
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);
// replace is a useful detainting function, but can't...
replace("<","<",name,[Global]);
replace("&","&",name,[Global]);
content("Hello "+name+"!
");
helloForm();
}
Void PostContent()
{
content("");
}