{$mode objfpc} {$H+} program testcgi; uses cgiapp,classes,sysutils; Type TTestCGI = Class(TCGIApplication) Procedure DoRun; override; end; Procedure TTestCGI.DoRun; Var L : TStrings; I: Integer; begin ContentType:='text/html'; EmitContentType; L:=TStringList.Create; Writeln('',title,''); Try Writeln('

List of CGI variables:

'); GetCGIVarList(L); For I:=0 to L.Count-1 do Writeln(L[i],'
'); Writeln('

List of environment variables:

'); GetEnvironmentList(L); For I:=0 to L.Count-1 do Writeln(L[i],'
'); If (RequestVariableCount>0) then begin Writeln('

List of form variables:

'); GetRequestVarList(L); For I:=0 to L.Count-1 do Writeln(L[i],'
'); Writeln('

List of form variables, tabular format:

'); Writeln(''); Writeln(''); GetRequestVarList(L,True); For I:=0 to L.Count-1 do Writeln(''); end; Finally Writeln(''); Terminate; end; end; begin With TTestCGI.Create(Nil) do Try Title:='Test CGI application'; Initialize; Run; Finally Free; end; end.
NameValue
',L[i],'',RequestVariables[L[i]],'