[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTP server question (2)



Rafael

The CGI program will run throw a result at your browser and exit... so it 
only runs once.

A simple way to refresh is to use the META REFRESH tag which you put in 
the <head> tag... so that the CGI
spits out an html output containing a web page with meta refresh.. so it 
will call itself again and the time will
be updated...  pretty crude but it will work..  there is a certain amount 
of overhead with cgi but it's simple.

e.g.  if the cgi program is named time.cgi, it could output something like 
the below text to the browser... the browser
will see the meta refresh and reload after 60 seconds

<html>
<head>
<META HTTP-EQUIV=Refresh CONTENT="60; URL=/cgi-bin/time.cgi">
</head>
<body>
<p>The time now is 1:10am.  This page will automatically refresh in 60 
seconds</p>
</body> 

Matt.





RCB <RACB@xxxxxxx.com>
Sent by: owner-dev-etrax@xxxxxxx.com
19/07/21 08:47 PM

 
        To:     Bjorn Wesen <bjorn.wesen@xxxxxxx.com>
        cc:     dev-etrax@xxxxxxx.com
        Subject:        HTTP server question (2)


Bjorn,

   Thanks for the hint; we already knew about the need to write a cgi. The
question is how to make the web page automatically update its contents
every second (for example). Should we do any of the following?
a) Call the cgi continously in some sort of cron-like process
b) Leave the cgi running and the web server will somehow know how to call 
it
c) Other option I am not guessing

Thanks again

  Rafael


>Write a cgi; you'll find a howto on that anywhere on the net.
>
>Basically you write a program which gets executed by a client access and
>any output from the program goes to the web-browser. So in this case your
>CGI can be as simple as a main() with a single printf() and
>gettimeofday()..
>
>You'll need to check with the boa configuration files to figure out where
>to put the resulting cgi binary though and to make sure it can get
>executed etc. It's not enough to just put it in /bin for example.
>
>/BW