Saving html form into oracle database

N

Nick

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
 
M

Michael Budash

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-
 
E

Eric Schwartz

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
 
M

Michael Budash

Eric Schwartz said:
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.


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.
 
E

Eric Schwartz

Michael Budash said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top