Article View: borland.public.cppbuilder.internet.web
Article #986Re: CGI : Auto-update
From: Mark Jacobs
Date: Wed, 05 Oct 2005 13:26
Date: Wed, 05 Oct 2005 13:26
47 lines
2820 bytes
2820 bytes
Andrew McIsaac wrote:
> Using the WebModule and PageProducer Component (this ex. = PP):
>
> TWebModule1::WebModule1Item1Action(...
> {
> for (i=1;i<10;i++)
> {
> PP1->HTMLDoc->Add("<HTML>");
> PP1->HTMLDoc->Add(" <BODY>");
> strcpy(html_line," CGI : I = ");
> strcat(html_line,i);
> PP1->HTMLDoc->Add(html_line);
> PP1->HTMLDoc->Add(" </BODY>");
> PP1->HTMLDoc->Add("</HTML>");
> Response->Content=PP1->Content();
> {
> ... some time delay loop or sleep
> }
> }...
> in this case I am trying to write the numbers 1 to 10
> consecutively with a delay, in a targeted frame of the HTML
> Page.
>
> And if a button is pressed (in a different frame of the same
> webpage) can this program be terminated and restarted, or are
> there going to be runaway apps? Or is there a better way to do
> this ?
I was under the impression that the job of a CGI program was to load, run and
exit, echoing the resultant HTML web page to stdout as it goes. It must run as
quickly as possible, so your idea of it hanging around with some kind of
mysterious ethereal connection to the browser that initiated it, will
definitely *not work*. You can get the page itself to increment a number on it
every second, using Javascript techniques. You can also use Javascript to
"submit" the form when a key is pressed, thereby restarting your CGI app. Good
luck.
http://www.w3schools.com/js/js_howto.asp
http://javascript-reference.info/
http://javascript.internet.com/tutorials/CoreReferenceJS15.zip
http://webreference.com/javascript/reference/core_ref/
http://javascript.internet.com/tutorials/CoreGuideJS15.zip
HTH
--
Mark Jacobs
http://www.dkcomputing.co.uk
Technical Details
Message-ID:
<4343d415$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43350eff$1@newsgroups.borland.com> <43353711$1@newsgroups.borland.com> <4337a00e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,2b3939a5fcf6d021 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 05 Oct 2005 14:26:57 +0100 From: Mark Jacobs <http://www.jacobsm.com/mjmsg.htm?mj@critical> User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.web Subject: Re: CGI : Auto-update References: <43350eff$1@newsgroups.borland.com> <43353711$1@newsgroups.borland.com> <4337a00e$1@newsgroups.borland.com> In-Reply-To: <4337a00e$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.144.157.8 Message-ID: <4343d415$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1128518677 81.144.157.8 (5 Oct 2005 06:24:37 -0700) Lines: 47 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail