source: branches/web/index.pas

Last change on this file was 286, checked in by george, 14 years ago
  • Odstraněno: Nadále nebude používána sada knihoven powutils.
  • Přidáno: Vlastní třída pro obsluhu a podporu zpracování CGI programů.
  • Upraveno: Korekce názvů sloupců a tabulek databáze.
  • Property svn:executable set to *
File size: 874 bytes
Line 
1program index;
2
3{$mode delphi}{$H+}
4
5uses
6 UCore, USqlDatabase, SysUtils, UMainPage,
7 UFinancePage, UNewsPage, UUserPage, UBill, UCGIApplication, UMainCGI, UStringListEx;
8
9type
10
11 { TMyCGIApplication }
12
13 TMyCGIApplication = class(TCGIApplication)
14 procedure Execute; override;
15 end;
16
17var
18 Application: TMyCGIApplication;
19
20{ TMyCGIApplication }
21
22procedure TMyCGIApplication.Execute;
23var
24 I: Integer;
25 PageName: string;
26begin
27 Output.Add('Hello friend');
28 SysInfo;
29
30 PageName := Query.Values['p'];
31 if PageName = '' then PageName := 'index';
32 I := 0;
33 while (I < Length(Pages)) and (Pages[I].Name <> PageName) do Inc(I);
34 if I < Length(Pages) then Output.Add(Pages[I].Producer)
35 else Output.Add('Stránka nenalezena');
36// WebWriteLn(FormatOutput(Output));
37end;
38
39begin
40 Application := TMyCGIApplication.Create;
41 Application.Run;
42 Application.Free;
43end.
Note: See TracBrowser for help on using the repository browser.