Saving html form into oracle database

Discussion in 'Perl Misc' started by Nick, Oct 1, 2003.

  1. Nick

    Nick Guest

    I'm new to perl programming. Just wanted to know if there is a way I
    could save the whole HTML FORM into database rather then saving it by
    individual fields.
    Someone mentioned it to me that it can be done. I just don't know how
    to do it.

    Reason I'm trying to do this is because im working on a FORM with
    about 50 input fields. All I need is a way to save this form and pull
    it back with the data and be able to make changes to it and save it
    again. I know I can run a sql query and save all the fields
    individually and do the same when I put the data back into the FORM
    before showing it but thats kinda lengthy approach. Anyone know a
    better way of doing this?? Don't know much about cgi.pm either.

    Thanks for your help.
    Nick
    Nick, Oct 1, 2003
    #1
    1. Advertising

  2. In article <>,
    (Nick) wrote:

    > I'm new to perl programming. Just wanted to know if there is a way I
    > could save the whole HTML FORM into database rather then saving it by
    > individual fields.
    > Someone mentioned it to me that it can be done. I just don't know how
    > to do it.
    >
    > Reason I'm trying to do this is because im working on a FORM with
    > about 50 input fields. All I need is a way to save this form and pull
    > it back with the data and be able to make changes to it and save it
    > again. I know I can run a sql query and save all the fields
    > individually and do the same when I put the data back into the FORM
    > before showing it but thats kinda lengthy approach. Anyone know a
    > better way of doing this?? Don't know much about cgi.pm either.
    >
    > Thanks for your help.
    > Nick


    the problem i see is that a cgi script is not delivered a form, it's
    delivered the names/values _in_ a form when that form was submitted. one
    possibility: have your form handler read in the static html file
    containing the form, fill it in, and save it to your db in a blob field
    (ugh!)

    hth-

    --
    Michael Budash
    Michael Budash, Oct 1, 2003
    #2
    1. Advertising

  3. Michael Budash <> writes:
    > In article <>,
    > (Nick) wrote:
    >> I'm new to perl programming. Just wanted to know if there is a way I
    >> could save the whole HTML FORM into database rather then saving it by
    >> individual fields.
    >> Someone mentioned it to me that it can be done. I just don't know how
    >> to do it.


    One approach is to save off the form parameters into a hash, and stuff
    the hash into a BLOB with Data::Dumper or Storable or some such module.

    > the problem i see is that a cgi script is not delivered a form, it's
    > delivered the names/values _in_ a form when that form was submitted. one
    > possibility: have your form handler read in the static html file
    > containing the form, fill it in, and save it to your db in a blob field
    > (ugh!)


    Ick. Just save the form parameters and values, and use CGI.pm to
    re-create the form along with the values you loaded from the
    database. Why make things so needlessly complicated?

    -=Eric
    --
    Come to think of it, there are already a million monkeys on a million
    typewriters, and Usenet is NOTHING like Shakespeare.
    -- Blair Houghton.
    Eric Schwartz, Oct 1, 2003
    #3
  4. In article <>,
    Eric Schwartz <> wrote:

    > Michael Budash <> writes:
    > > In article <>,
    > > (Nick) wrote:
    > >> I'm new to perl programming. Just wanted to know if there is a way I
    > >> could save the whole HTML FORM into database rather then saving it by
    > >> individual fields.
    > >> Someone mentioned it to me that it can be done. I just don't know how
    > >> to do it.

    >
    > One approach is to save off the form parameters into a hash, and stuff
    > the hash into a BLOB with Data::Dumper or Storable or some such module.
    >
    > > the problem i see is that a cgi script is not delivered a form, it's
    > > delivered the names/values _in_ a form when that form was submitted. one
    > > possibility: have your form handler read in the static html file
    > > containing the form, fill it in, and save it to your db in a blob field
    > > (ugh!)

    >
    > Ick. Just save the form parameters and values, and use CGI.pm to
    > re-create the form along with the values you loaded from the
    > database. Why make things so needlessly complicated?
    >
    > -=Eric


    here's why:

    the o.p. asked to save the _form_. forms are more than simply names and
    values. they involve input methods of indicating those values (text
    boxes, radio button, checkboxes, select's, etc.). your method does not
    allow the o.p. to recreate the form with those methods intact.
    admittedly, the o.p. did not specifically say that's what he wanted, but
    i assumed it.

    --
    Michael Budash
    Michael Budash, Oct 1, 2003
    #4
  5. Michael Budash <> writes:
    >> Ick. Just save the form parameters and values, and use CGI.pm to
    >> re-create the form along with the values you loaded from the
    >> database. Why make things so needlessly complicated?
    >>
    >> -=Eric

    >
    > here's why:
    >
    > the o.p. asked to save the _form_. forms are more than simply names and
    > values. they involve input methods of indicating those values (text
    > boxes, radio button, checkboxes, select's, etc.). your method does not
    > allow the o.p. to recreate the form with those methods intact.


    Yes it does. That's what the bit about "use CGI.pm to re-create the
    form along with the values you loaded from the database" was about.
    Of course, CGI.pm isn't necessary, but its sticky form creator will
    work as well as any other.

    If you generate the form programatically in the first place, then
    adding code that looks like

    {
    no warnings;
    my %vals = loadFormValues();

    print <<EOFORM
    .....
    <input name="somename" value="$vals{somename}">
    .....
    EOFORM
    }

    is easy, and *poof*, there's your re-created form, with values
    pre-filled from a database.

    > admittedly, the o.p. did not specifically say that's what he wanted, but
    > i assumed it.


    You also assumed that the form is static, and not able to be generated
    by a script. Seems a very baroque assumption to make, especially when
    it makes the solution much harder.

    -=Eric
    --
    Come to think of it, there are already a million monkeys on a million
    typewriters, and Usenet is NOTHING like Shakespeare.
    -- Blair Houghton.
    Eric Schwartz, Oct 2, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dhara
    Replies:
    1
    Views:
    1,147
  2. Replies:
    2
    Views:
    556
    =?iso-8859-1?q?Stephan_Br=F6nnimann?=
    Jan 19, 2006
  3. geeteshss
    Replies:
    0
    Views:
    407
    geeteshss
    Jun 20, 2007
  4. Vincent Le-Texier
    Replies:
    1
    Views:
    142
    Paul Lalli
    Dec 3, 2004
  5. Feyruz
    Replies:
    4
    Views:
    2,125
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page