• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

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
0
MrNet
Asked:
MrNet
1 Solution
 
DragonSlayerCommented:
what does the counter return?  (I mean in what format and WHAT...)
0
 
simonetCommented:
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
0
 
MrNetAuthor Commented:
DragonSlayer,
the counter return PLAIN-TEXT number .. I should use HTML tags to decorate it like :
<font color="red"><#COUNTER></font>
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

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
RadlerCommented:
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:=stream
3 -Call Response.SendResponse.

Warning dont call Streamer.Free before afterDispacth.

If necessary a snap of code

      try
            //Pega nome do contador
            CounterName:=Request.QueryFields.Values[ '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:='image/jpeg';
                              Response.ContentStream:=Strm;
                              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.
0
 
RadlerCommented:
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.
0
 
MrNetAuthor Commented:
Thanx Radler,

but I asked about another thing.


Pls .. if you know, try help me.

0
 
HamidHossainCommented:
That is impossible
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now