[Webdev] continuous output...
phil at redbrick.dcu.ie
Wed Nov 15 16:01:12 GMT 2000
Dave Wilson's [dave.wilson at heanet.ie] 22 lines of wisdom included:
:>> I'm trying to write a CGI or something that'll output something
:>> continuous. As a tester, something like:
:>I'm going purely from memory here, so I may be misleading you, but ISTR that
:>in Apache it sufficed to rename your CGI script so that the name starts with
:>"nph-", and begin your output with "200 OK\nContent-type: text/html\n\n"
You can use a technique called Server push as well.
Set your content type as
echo "Content-type: multipart/x-mixed-replace;boundary=MyBoundaryMarker"
echo Content-type: text/html
echo "<BODY><P>The current date is: <B>"
Something like that should suffice in getting the date updated every 10
seconds. AFAIK you should be able to do the same thing with tail.
It generally used to be used for animated icons but was phased out by Java and
animated .GIF's. You can still use it though.
More information about the Webdev