MrNet
asked on
Excute CGI onLoad
Hi,
I made a small (Text-Based) Counter using Delphi cgi ..
Please tell me How I excute it in my index.htm file .. is there a special HTML tag or what ??!!!
Note : I Want to get TEXT-BASED Counter
I made a small (Text-Based) Counter using Delphi cgi ..
Please tell me How I excute it in my index.htm file .. is there a special HTML tag or what ??!!!
Note : I Want to get TEXT-BASED Counter
what does the counter return? (I mean in what format and WHAT...)
A graphical counter would be easier to add to the page.
If you want, I have the source for a graphical CGI counter, made in Delphi, and the source to add it to the page.
Alex
If you want, I have the source for a graphical CGI counter, made in Delphi, and the source to add it to the page.
Alex
ASKER
DragonSlayer,
the counter return PLAIN-TEXT number .. I should use HTML tags to decorate it like :
<font color="red"><#COUNTER></fo nt>
but that could't run in TEXT-Counters.
simonet,
Actually I have an old Graphical if you can send me the source for your counter I will be happy ..
my EMail: MrNet10@hotmail.com
the counter return PLAIN-TEXT number .. I should use HTML tags to decorate it like :
<font color="red"><#COUNTER></fo
but that could't run in TEXT-Counters.
simonet,
Actually I have an old Graphical if you can send me the source for your counter I will be happy ..
my EMail: MrNet10@hotmail.com
Hi MrNet;
I made this recently;
The tag is like this
< IMG = "http://??????/?????/YourCounter.DLL?Parm1=?&Param2=??" >
At your dll put the method to get and read the values to better process.
with Response do:
1 - Save a JPG image to a stream set the position to 0
2 - Do response.ContentStream:=st ream
3 -Call Response.SendResponse.
Warning dont call Streamer.Free before afterDispacth.
If necessary a snap of code
try
//Pega nome do contador
CounterName:=Request.Query Fields.Val ues[ 'countername' ];
if CounterName = EmptyStr then begin
SendErrorImg( Response );
Exit;
end;
//Checa se ha setvalue ##alteraca do valor
if Request.QueryFields.Values [ 'set' ] <> EmptyStr then begin
try
CountID:=StrToInt( Request.QueryFields.Values [ 'set' ] );
except
SendErrorImg( Response );
Exit; //Cancela atualizacao
end;
Self.SetCountValue( CounterName , CountID )
end;
//Pega valor apos ter incrementado anterior
CountID:=ProcessCountID( CounterName );
if CountID <> 0 then begin
Img:=TJPEGImage.Create;
try
Self.GetNumberImg( CountId, Img );
Strm:=TMemoryStream.Create ;
try
Img.SaveToStream( Strm );
Strm.Position:=0;
Response.ContentType:='ima ge/jpeg';
Response.ContentStream:=St rm;
Response.SendResponse;
finally
//Nao liberar o streamer aqui isso sera feito apos dispatch !!!!!!!!!!!!!
end;
finally
Img.Free;
end;
end else begin
//Falha no processo deve ser informada com grafico correlato
Self.SendErrorImg( Response );
end;
finally
Handled:=True;
end;
end;
the comments in portuguese, sorry.
T++, Radler.
I made this recently;
The tag is like this
< IMG = "http://??????/?????/YourCounter.DLL?Parm1=?&Param2=??" >
At your dll put the method to get and read the values to better process.
with Response do:
1 - Save a JPG image to a stream set the position to 0
2 - Do response.ContentStream:=st
3 -Call Response.SendResponse.
Warning dont call Streamer.Free before afterDispacth.
If necessary a snap of code
try
//Pega nome do contador
CounterName:=Request.Query
if CounterName = EmptyStr then begin
SendErrorImg( Response );
Exit;
end;
//Checa se ha setvalue ##alteraca do valor
if Request.QueryFields.Values
try
CountID:=StrToInt( Request.QueryFields.Values
except
SendErrorImg( Response );
Exit; //Cancela atualizacao
end;
Self.SetCountValue( CounterName , CountID )
end;
//Pega valor apos ter incrementado anterior
CountID:=ProcessCountID( CounterName );
if CountID <> 0 then begin
Img:=TJPEGImage.Create;
try
Self.GetNumberImg( CountId, Img );
Strm:=TMemoryStream.Create
try
Img.SaveToStream( Strm );
Strm.Position:=0;
Response.ContentType:='ima
Response.ContentStream:=St
Response.SendResponse;
finally
//Nao liberar o streamer aqui isso sera feito apos dispatch !!!!!!!!!!!!!
end;
finally
Img.Free;
end;
end else begin
//Falha no processo deve ser informada com grafico correlato
Self.SendErrorImg( Response );
end;
finally
Handled:=True;
end;
end;
the comments in portuguese, sorry.
T++, Radler.
MrNet;
Sorry again;
I stay empolged and send to a image based case.
And again and again, I don't see the Simonet comment.
T++, Radler.
Sorry again;
I stay empolged and send to a image based case.
And again and again, I don't see the Simonet comment.
T++, Radler.
ASKER
Thanx Radler,
but I asked about another thing.
Pls .. if you know, try help me.
but I asked about another thing.
Pls .. if you know, try help me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.