U
Unicorn
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是我的两个CGI响应事件:
procedure TWebModule1.WebModule1ListAllAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var HTML:string;
begin
HTML:='<HTML>';
HTML:=HTML+'<BODY>';
Table1.First;
while not Table1.Eof do
begin
HTML:=HTML+'<P>';
HTML:=HTML+Format('<a href="../scripts/pecgi.dll/listperson?id=%d">%s</a>',[Table1.fieldbyname('id').asinteger,Table1.fieldbyname('name').asstring]);
HTML:=HTML+'</P>';
Table1.Next;
end;
HTML:=HTML+'</BODY>';
HTML:=HTML+'</HTML>';
Response.Content:=HTML;
end;
procedure TWebModule1.WebModule1ListPersonAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
if Table1.Locate('id', Request.QueryFields.Values['id'], []) then
begin
ListPersonInfo.Header.Clear;
ListPersonInfo.Header.Add('This is the information about '+Table1.fieldbyname('name').asstring);
Response.Content:=ListPersonInfo.Content;
end
else
Response.Content := Format('<html><body><b>Name: %s not found</b></body></html>',[Request.QueryFields.Values['id']]);
end;
但是当我运行时,ListAll结果是正确的,但是一用到ListPerson
就出错:服务器错误(87),这到底是怎么回事呢?
procedure TWebModule1.WebModule1ListAllAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var HTML:string;
begin
HTML:='<HTML>';
HTML:=HTML+'<BODY>';
Table1.First;
while not Table1.Eof do
begin
HTML:=HTML+'<P>';
HTML:=HTML+Format('<a href="../scripts/pecgi.dll/listperson?id=%d">%s</a>',[Table1.fieldbyname('id').asinteger,Table1.fieldbyname('name').asstring]);
HTML:=HTML+'</P>';
Table1.Next;
end;
HTML:=HTML+'</BODY>';
HTML:=HTML+'</HTML>';
Response.Content:=HTML;
end;
procedure TWebModule1.WebModule1ListPersonAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
if Table1.Locate('id', Request.QueryFields.Values['id'], []) then
begin
ListPersonInfo.Header.Clear;
ListPersonInfo.Header.Add('This is the information about '+Table1.fieldbyname('name').asstring);
Response.Content:=ListPersonInfo.Content;
end
else
Response.Content := Format('<html><body><b>Name: %s not found</b></body></html>',[Request.QueryFields.Values['id']]);
end;
但是当我运行时,ListAll结果是正确的,但是一用到ListPerson
就出错:服务器错误(87),这到底是怎么回事呢?