使用web server application 做成cgi或isapi,代码如下:
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
response.content:='<html><body><form metod=post action=getpost>';
response.content:=response.content + '<input type=text name=abc><input type=submit value="提交"></form>';
end;
procedure TWebModule1.WebModule1WebActionItem2Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
response.content:=request.contentfield.values['abc'];
end;
添加一个adoquery控件即可操作将数据存入。
将WebActionItem1的default设为true;
将WebActionItem2的pathinfo设为getpost;