> From: Bob Mariotti <[EMAIL PROTECTED]>
> Subject: [Boston.pm] OT but still a perl technique question?

> I have an incoming form that requests a search for a LOT of information. 
>   Because we're not google here it could take anywhere from 2 to 15 
> seconds for the reply to be generated and returned.   Therefore, I would 
> like to send a page that has an animated gif image along with some kind 
> words that the user can see and not become spastic because their request 
> is taking longer than instantaneous.
> 
> I have tried many variations of content type with multipart etc., but 
> they always end with an apache error of "malformed header".
> 
> If anyone is or has done this before, would you please be so king as to 
> provide some guidance and perhaps some snippet examples?


Sure.  When the user submits the request form, don't invoke the
request right away.  Instead, send back something like this.

(Disclaimer - sloppy html coding below.  This isn't guaranteed to be
correct, it's just intended to give the basic idea).  General gist -
send back a page with the "waiting" animation that will "submit itself".

  <html>
  <body onLoad="javascript:document.myform.submit()">
  <img src="animated.gif">
  <form name="myform" method="GET" action="search.cgi">
    <input type="hidden" name="query" value="what user entered">
  </form>
  </body>
  </html>

Alternative two: send back a page that uses a refresh to execute the
actual query:

<html>
<head>
<meta http-equiv="Refresh" 
  content="0; url=http://yourhost.net/dosearch.cgi?query=what+the+user+said";>
</head>
<body>
<img src="animated.gif">
</body>
</html>


hth.

-- 
Steve Revilak

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

Reply via email to