Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Populate HTML form with values from database

by peacemaker1820 (Pilgrim)
on Jan 21, 2003 at 19:00 UTC ( #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.
  • 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:
    Also, I'd go to - 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 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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2020-11-24 18:29 GMT
Find Nodes?
    Voting Booth?

    No recent polls found