Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Passing form data between scripts

by shemp (Deacon)
on Apr 01, 2005 at 00:26 UTC ( #444028=note: print w/replies, xml ) Need Help??

in reply to Passing form data between scripts

hidden form fields is one way.

Replies are listed 'Best First'.
Re^2: Passing form data between scripts
by b310 (Scribe) on Apr 01, 2005 at 01:25 UTC

    How do I accomplish using hidden form fields?

    Do I define the hidden fields in the first form which passes to the first script (camp.cgi)?

    Thanks for your help.
      In one page, inside a form, you can have a hidden field of the form <input type="hidden" name="thing" value="$thing"> and the script invoked by the form then gets the value by using param (using, of course), i.e. $thing=param('thing') You can use to produce the code for the hidden field using something like print hidden(-name=>"thing1",-value=>"thing2"); but I seem to recall having difficulty getting variables to interpolate in the value, so I've usually used the explicit first way. (If someone can comment on the interpolation problem, I'd be happy to hear about that...) The CGI module has built-in handling of "stickiness" (i.e. maintaining state (and I believe this makes use of hidden fields in a clever way... I don't understand it very well)) but it usually takes me such a lot of messing around to get it to work properly that I mostly just use hidden fields myself. That's not meant to detract from at all - it is a wonderful tool, I just don't know it well enough. (I always use, I just don't always use all of the subtleties available.)

        Thanks for the reply. I think I see where you're going with this. I just want to clarify something.

        The form that is being sumbitted is an HTML form. One of the fields is name. From articles I read about HTML and hidden fields, when I type the following line:
        <input type="hidden" name="member" value="hard coded value">

        The "value" parameter in the articles are setting a hard coded value to each name="member". In this case, the value for name or member is going to be different for every person who completes the form.

        How do I write my hidden field in the form so it doesn't pass hard coded values instead it will pass the actual info entered by the person completing the form? I guess what I'm asking is how do I set a value for "member" that is global? I think?.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://444028]
and monks are getting baked in the sun...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2018-04-21 10:49 GMT
Find Nodes?
    Voting Booth?