Loading ...
Sorry, an error occurred while loading the content.
 

How to clean a POSTed variable

Expand Messages
  • Fernando Munoz
    Is there a way to clean partially or totally the buffer with the variables POSTed by a form. My problem is that every time the page is reloaded the perl ASP
    Message 1 of 2 , Jul 17, 2002
      Is there a way to clean partially or totally the buffer with the variables
      POSTed by a form. My problem is that every time the page is reloaded the
      perl ASP script run again and add to a DB. I'm using a variable to determine
      from where this page was called which a Request-> for their value and
      depending on that I add some info to a DB. But if the browser is
      "refresh/reloaded" the DB is updated again. Is it possible to change that
      variable value after asking for it to avoid a reload to affect the DB
      twice. Anyone has a workaround for this.

      Thanks !

      Fernando Munoz


      ___________________________________________________
      Lions Gate Entertainment, Inc. [ AMEX: lgf ]
      Five Proud Years, One Independent Spirit.

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... The kind of trick I usually use to avoid the double-click or reload effect is to do something like: $Session- Lock;
      Message 2 of 2 , Jul 17, 2002
        Fernando Munoz wrote:
        > Is there a way to clean partially or totally the buffer with the variables
        > POSTed by a form. My problem is that every time the page is reloaded the
        > perl ASP script run again and add to a DB. I'm using a variable to determine
        > from where this page was called which a Request-> for their value and
        > depending on that I add some info to a DB. But if the browser is
        > "refresh/reloaded" the DB is updated again. Is it possible to change that
        > variable value after asking for it to avoid a reload to affect the DB
        > twice. Anyone has a workaround for this.
        >

        The kind of trick I usually use to avoid the double-click
        or reload effect is to do something like:

        $Session->Lock;
        unless($Session->{'trasaction_'.$transaction_id}++) {
        # process transaction
        }
        $Session->UnLock;

        You cannot really clean the POST buffer once the transaction
        has occured because the browser is able to re-POST on its own.

        Though if you found the right time to do so you clear the
        current POST request data like

        %{$Request->{Form}} = ();

        I don't think you would ever do this, but I demo the command
        should you ever want to. You could create some kind of fancy
        transaction handler that automatically cleared the current
        Form data given certain conditions for example.

        --Josh
        ________________________________________________________________
        Josh Chamas, Founder phone:714-625-4051
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checking http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.