On Fri, Mar 28, 2003 at 04:43:44PM -0800, Ranga Nathan wrote:

>    I have a small CGI problem that someone else would have solved,
>    perhaps easily! I want to return a progress message ('please wait..')
>    before returning the actual output, which could take a few seconds.
>    How would I do that?  When I tried the following,  the progress
>    message stays on the page instead of being overwritten.
[...]
>    I also tried a script writing HTML with meta refresh and directing to
>    another URL. In this case the browser (I.E) kept re-fetching the first
>    script!

One possible solution is to send the "please wait" page to the
user with a refresh directive in the HTTP header:

  #!/usr/bin/perl -w
  use strict;
  use CGI qw/:standard/;

  my $page= 'go_here_after_processing.htm';
  print header(-refresh => "2; URL=$page");
  print start_html, p('Please wait...'), end_html;

With (most?) browsers, this will display a plain page with the
"please wait" message, wait two seconds, and then load $page. 

The problem with this approach is that you must specify the
number of seconds for the client to pause before loading the
target page, which may not be enough time for your processing to
complete.

I hope this helps.

-E
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to