A "real" HTTP redirect has to be in the header, not in the page BODY. You could use a <META> refresh or/and a javascript one which will work for most.

It depends on how long it takes to process your form data. If it can vary a lot than this is probably not the best solution. Impatient people might hit refresh submitting duplicates to your form.

There's a lot of ways to do it, (server push, refreshes, etc)

Are you putting the results into a file? If so I would opt for something simple like this. Make sure you use Taint.
The script that processess the form post does the following. One caveat is that if you have a lot of form data, the self_url() returned by CGI.pm may get truncated by the browser. If that's the case, you could make the url by hand. (Only need the resultsid parameter.)

IMHO the benefits of this is that it is fairly agnostic of the server and browser and you could reuse it pretty easily for other forms like this by changing the function that processes the form and prints the output. This method makes it hard for the user to duplicate the form post by clicking Refresh or Reload because they are instantly moved to a different url. There are other ways of doing this as well but this down and dirty way will suffice for most apps.

You could also have this the same script that prints out the form as well. Just check for any param() and if there none, print out the form. Do this before the logic that looks for the resultsid.

-Lee

"To be civilized is to deny one's nature."

In reply to Re: Re: Re: A question on BEGIN{} by shotgunefx
in thread A question on BEGIN{} by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.