rkmase has asked for the wisdom of the Perl Monks concerning the following question:

I know, I'm probably missing some fundamental CGI.pm thing here that I've overlooked a dozen times now - but here's what I would like to do:

Accept input from user -> pass input to a third party server AND display "waiting for your results" HTML page (it can take awhile) -> results return/CGI processes them -> display new HTML page with results.

I've looked in the archives and seen a couple tips, but nothing substantial enough to push me in the right direction-
* don't fork, for speed's sake
* use Apache callbacks (I don't know what/how these are referring too - Google was no help)

Would it be good practice/acceptable to run two CGI scripts, one after another? (a waiting.cgi and a results.cgi script) Any other suggestions, tips, wisdom?

Thanks!
  • Comment on CGI - Load HTML while waiting for process to finish/display more HTML

Replies are listed 'Best First'.
Re: CGI - Load HTML while waiting for process to finish/display more HTML
by olus (Curate) on Nov 21, 2007 at 15:22 UTC
    Looks like a good candidate for an AJAX approach if using javascript is an option for your work.
    There are lots of examples as the spin-wheels seem to be on the hype nowadays.
    Here you can find some artwork you can show to your users.
    --
    olus
Re: CGI - Load HTML while waiting for process to finish/display more HTML
by KurtSchwind (Chaplain) on Nov 21, 2007 at 16:11 UTC

    I'm with olus on this one. Ajax would be a good approach. What you want to do is query back for the results and display them when they are ready. That's exactly what AJAX excels at.

    --
    I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.
Re: CGI - Load HTML while waiting for process to finish/display more HTML
by Anonymous Monk on Nov 21, 2007 at 15:38 UTC