Variable extracted out of one form not there anymore after submitting another form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • damn

    Variable extracted out of one form not there anymore after submitting another form

    Hi,

    in short what I'm trying to do: pass a variable from a form that's posted
    to a certain page, to the same page. The variable is extracted with
    $_REQUEST. Next, another form in the same page is submitted, again to the
    same page. Following that, I have code depending on the submission of the
    latter form. In that code, I try to do something with the variable that
    has been submitted with the first form, but it's not there anymore. I
    tried passing it to another variable beforehand, making it a session
    variable, making the $_REQUEST conditional, etc etc. But nomatter what I
    do, it remains empty.

    What's the correct way to go about this?


    Thx a mille!


    B.
  • mootmail-googlegroups@yahoo.com

    #2
    Re: Variable extracted out of one form not there anymore after submitting another form

    damn wrote:
    What's the correct way to go about this?
    Perhaps the easiest solution is to populate hidden form elements with
    the values you wish to persist from the previous form. This way, those
    values will be available in the $_REQUEST array when you submit the
    form again.

    Comment

    • Juliette

      #3
      Re: Variable extracted out of one form not there anymore after submittinganoth er form

      mootmail-googlegroups@ya hoo.com wrote:
      damn wrote:
      >What's the correct way to go about this?
      >
      Perhaps the easiest solution is to populate hidden form elements with
      the values you wish to persist from the previous form. This way, those
      values will be available in the $_REQUEST array when you submit the
      form again.
      >

      Alternatively, if the two forms are shown at the same time on the page,
      change your code to one form instead of two and use different values for
      the submit button of the 'virtual two' forms.
      In your php script, all (filled in) $_POST values will then be
      available, and you can let your script decide what to do based on the
      value of submit.

      Grz, Jrf

      Comment

      • damn

        #4
        Re: Variable extracted out of one form not there anymore after submitting another form

        On Thu, 10 Aug 2006 13:54:41 -0700, mootmail-googlegroups wrote:
        damn wrote:
        >What's the correct way to go about this?
        >
        Perhaps the easiest solution is to populate hidden form elements with
        the values you wish to persist from the previous form. This way, those
        values will be available in the $_REQUEST array when you submit the
        form again.
        Great stuff, will definitely try that!

        Thx!


        B.

        Comment

        • Juliette

          #5
          Re: Variable extracted out of one form not there anymore after submittinganoth er form

          damn wrote:
          On Thu, 10 Aug 2006 13:54:41 -0700, mootmail-googlegroups wrote:
          >
          >damn wrote:
          >>What's the correct way to go about this?
          >Perhaps the easiest solution is to populate hidden form elements with
          >the values you wish to persist from the previous form. This way, those
          >values will be available in the $_REQUEST array when you submit the
          >form again.
          >
          Great stuff, will definitely try that!
          >
          Thx!
          >
          >
          B.

          By the by: if you expect the information through a post, use the $_POST
          array - form injection through the $_REQUEST array is known to happen.

          Comment

          Working...