Assuming I'm understanding your question, you'd like to avoid the user getting 2 page updates, one to get the cookie, the second to load the second page of the form. Essentially, you can't "do" anything in the browser without it loading a page. The way I tend to handle multipage scripts is to put all the functions into one script, rather than a mix of CGIs to process them and HTML pages served separately.
In your example, your script called with no parameters would print the first page (either by including the HTML in you script, or by opening a file containing the page or page snippet and printing its contents); the script called with valid form fields prints the second page, including a cookie header; the script called with invalid form fields prints the first page, possibly processed to mark which field was incorrectly filled in, pre-fills any fields the user entered correctly, etc.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|