Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Populate HTML form with values from database

by peacemaker1820 (Pilgrim)
on Jan 21, 2003 at 19:00 UTC ( [id://228793]=perlquestion: print w/replies, xml ) Need Help??

peacemaker1820 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I have a static HTML form that submits about 25-50 fields including, radio, checkboxes, text, selection, etc. to my database.
Now, what I would like to do is to let people who fill these forms in, revise the form and edit it if necessary.
For this I need to take all the fields from my database and populate it back into the original boxes on my HTML form (file name:"ex.html").

How do I do that?

I have tried reading about CGI...but I did not understand. If anyone can be of more help, I would really appreciate it.
Thanks.
  • Comment on Populate HTML form with values from database

Replies are listed 'Best First'.
Re: Populate HTML form with values from database
by hmerrill (Friar) on Jan 21, 2003 at 21:45 UTC
    I would suggest:
    1. buy book "Learning Perl" by Randal Schwartz and Tom Christiansen - I believe there's a 3rd edition now. It's an excellent primer, and it has a whole chapter on CGI programming. 2. I did perldoc -q cgi and came up with this section: Where can I learn about CGI or Web programming in Perl? For modules, get the CGI or LWP modules from CPAN. For + text‐ books, see the two especially dedicated to web stuff in + the question on books. For problems and questions related +to the web, like ‘‘Why do I get 500 Errors’’ or ‘‘Why doesn’t +it run from the browser right when it runs fine on the command + line’’, see the troubleshooting guides and references in perlfa +q9 or in the CGI MetaFAQ: http://www.perl.org/CGI_MetaFAQ.html
    Also, I'd go to www.perl.com - look there. And go to google and search for "perl cgi tutorial" or something similar. HTH.
      I would add to that list the Official Guide to Programming with CGI.pm by Lincoln Stein as it spells out an approach to do what you have indicated. Lots of other stuff as well, of course!
Re: Populate HTML form with values from database
by Aristotle (Chancellor) on Jan 22, 2003 at 14:21 UTC
    If you really just want to work with static forms, you can use plain HTML files and apply HTML::FillInForm to preset fields to specific values. In case you want anything more out of the code, like dynamically generate forms based on some of your data, I would suggest a proper templating module. perrin's templating system comparison is a good place to start.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://228793]
Approved by pfaut
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2024-04-16 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found