in reply to Re: page expired message
in thread page expired message

Pardon my ignorance, but what do you mean - redirect at the end of every form handler. The way my page is created, I build the page from several places. I basically create a print statement that puts out the header, the dynamic middle part, and the trailer. There is never really an html page except the one I am creating.

Each page has a menu structure surrounded by a form that calls a main script (index.cgi) that builds the next page. So no matter what page you go to on my site, you are at index.cgi and it builds your output.

Is there a way around this with my methodology? Thanks.

Replies are listed 'Best First'.
Re^3: page expired message
by Tuppence (Pilgrim) on Jan 03, 2005 at 19:03 UTC

    I mean that every time a user clicks a submit button to submit a POST form, you follow these steps:

    1. Handle the form. This means creating the order, flipping the status field on your table, or whatever
    2. Redirect to a status page. This might need some massaging of variables to be passed along the request line in order to get enough information to say what happened, but it will remove the flaw in your page-to-page flow.

    This all stems from HTML not being meant to contain state information, and having that bolted on leaves a few rough edges such as this one.

    If this is still unclear please say so and I'll try to come up with a fleshed out example

Re^3: page expired message
by ww (Archbishop) on Jan 03, 2005 at 19:51 UTC
    More a workaround than a solution, but...
    Add a big label that says "Do not use your back button" in the header (or in each script producing the "dynamic" content
    PLUS
    build into your footer a link to something reasonable. Use standard .html if you're using a HERE for the footer; quote and escape VERY carefully if your footer is comprised of a bunch of

    print "<p>something....</p>"; print "<p>something else...</p>";" print "<p><a href='path/to/something/reasonable...'>something reasonab +le</a></p>"; print "</body></html>";

    where "something reasonable" is your home "page," the top "page" in the section from which the submit calls the cgi, etc.

      Add a big label that says "Do not use your back button"
      just a note: i hate websites that do that, especially if you get wrong results if you do use the button. i have a browser with back- and forward buttons (or keyboard shortcuts), and i want to use them. i might not be the only one.

      i'm pretty sure every problem like this can be solved in a way so that the user might use their browser like it is meant to. otherwise HTTP is probably not the right protocol for the task.
      just my 2 cents.

        agree, pretty much, but "what I want" and "what my client's browser lets them do" are all too often, "dissimilar."