procedure TForm1.IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
Var
Stream: TFilestream;
TheString :
String;
i, Anzahl : Integer;
begin
if ARequestInfo.Document = '
/'
then
begin
try
begin
AResponseInfo.ContentType := '
text/html';
Stream := TfileStream.Create('
Admin/login.htm', fmOpenRead
or fmShareDenyWrite );
AResponseInfo.ContentStream := Stream;
setlength(TheString, stream.size);
stream.
Read(TheString[1], stream.size);
Anzahl := ARequestInfo.Params.Count;
for i := 1
to Anzahl
do
if (parse('
=', ARequestInfo.params[0], 1) = '
submit')
and
(parse('
=', ARequestInfo.params[0], 2) = '
1')
then
if (parse('
=', ARequestInfo.params[1], 1) = '
username')
and
(parse('
=', ARequestInfo.params[1], 2) = '
Assun')
then
if (parse('
=', ARequestInfo.params[2], 1) = '
password')
and
(parse('
=', ARequestInfo.params[2], 2) = '
test')
then begin
AResponseInfo.ContentType := '
text/html';
Stream := TfileStream.Create('
Admin/test.htm', fmOpenRead
or fmShareDenyWrite );
AResponseInfo.ContentStream := Stream;
setlength(TheString, stream.size);
stream.
Read(TheString[1], stream.size);
userok := true;
end;
if ARequestInfo.Document = '
/go'
then
begin
try
Caption := '
GEHT DOCH MAAAAAAAN';
except
Exit;
end;
end;
end;
except
Exit;
end;
end;
end;