Changeset 286 for branches/web/index.pas
- Timestamp:
- Sep 8, 2010, 10:08:43 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/web/index.pas
r283 r286 5 5 uses 6 6 UCore, USqlDatabase, SysUtils, UMainPage, 7 UFinancePage, UNewsPage, UUserPage, UBill; 7 UFinancePage, UNewsPage, UUserPage, UBill, UCGIApplication, UMainCGI, UStringListEx; 8 9 type 10 11 { TMyCGIApplication } 12 13 TMyCGIApplication = class(TCGIApplication) 14 procedure Execute; override; 15 end; 8 16 9 17 var 10 Output: string; 18 Application: TMyCGIApplication; 19 20 { TMyCGIApplication } 21 22 procedure TMyCGIApplication.Execute; 23 var 11 24 I: Integer; 12 25 PageName: string; 13 26 begin 14 // SetHeader('Content-Type', 'text/html; charset=utf-8'); 15 //PageName := GetCgiVar('p'); 27 Output.Add('Hello friend'); 28 SysInfo; 29 30 PageName := Query.Values['p']; 16 31 if PageName = '' then PageName := 'index'; 17 32 I := 0; 18 33 while (I < Length(Pages)) and (Pages[I].Name <> PageName) do Inc(I); 19 if I < Length(Pages) then Output := Pages[I].Producer20 else Output := 'Stránka nenalezena';34 if I < Length(Pages) then Output.Add(Pages[I].Producer) 35 else Output.Add('Stránka nenalezena'); 21 36 // WebWriteLn(FormatOutput(Output)); 37 end; 38 39 begin 40 Application := TMyCGIApplication.Create; 41 Application.Run; 42 Application.Free; 22 43 end.
Note:
See TracChangeset
for help on using the changeset viewer.