Lots of ways. You've already stumbled upon the most obvious, which is to tack the values onto the end of the redirect URI. However, this is by no means the only way.

You can remember session information via cookies on the user's browser (or place a session identifier at the end of your link URLs or as <input type="hidden" .../> fields in forms). You can then have a temporary file on the local machine keyed to that session value storing the information, which may be restored. In fact, CGI contains a rather nice facility to help with this via the save method.

You could also save the data to something like a database. If you use cookies and the amount of data to be stored is relatively small, you could store the data in the cookie itself. (Won't work well for you, though, if you get many paranoid folks such as myself who mostly turn off cookies.)

Another solution I can think of would be to execute form.cgi directly within your processor script. This would replace $q->redirect("form.cgi") with a do, eval, or require to compile and execute the other form script's code. This way it could inherit the state directly, rather than be executed on its own via a second user request. Of course, this means that the form would appear at the processor URL, but it's another possibility.


In reply to Re: Keeping Form Values by hanenkamp
in thread Keeping Form Values by peschkaj

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.