[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Single Page

Top Document: FAQ: Frequently Asked Questions about CGI Programming
Previous Document: 3.8 Can I launch a long process and return a page before it's finished?
Next Document: 3.10 Can I password-protect my pages?


3.9 Can I launch a long process which the user interacts with?



This does not fit well with the basic mechanics of the Web, in which
each transaction comprises a single request and response.
If your processing can be done on the Client machine, you can use
a clientside application; for example a Java applet.

For processing on the server, one trick that works well for Clients
running an X server (and far more efficient than a JAVA solution) is:
  if ( fork() ) {
    print HTML page explaining what's going on and advising about xhost
  } else {
    exec ("xterm -display THEIR_DISPLAY -title MY_APP -e MY_PROG ARGS
        < /dev/null > /dev/null 2>&1 &") ;
  }
NOTE: THEIR_DISPLAY is not necessarily the same as REMOTE_HOST or REMOTE_ADDR.
You have to ask users to supply their display (set REMOTE_HOST as default).

A JAVA terminal program will accomplish something similar for the many
users with platforms that support JAVA but not X.




Top Document: FAQ: Frequently Asked Questions about CGI Programming
Previous Document: 3.8 Can I launch a long process and return a page before it's finished?
Next Document: 3.10 Can I password-protect my pages?

Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
Nick Kew <nick@webthing.com>

Last Update October 22 2009 @ 05:36 AM

Some parts © 2009 Advameg, Inc.