Dennis Wicks wrote:
Greetings;
I want to setup a form on a web page that a visitor can fill in then
send it back to me by email so I can browse it online and print it out
locally in the correct format. I have the way to define the input form
figured out, but the transmission and browsing and printing the form
are giving me trouble, to say the least!
My public web server (Apache) is not local. I have a local Apache2 web
server that I use for testing.
Can anybody point me to a tutorial or example of how to do this?
(Using perl, of course!)
Many TIA!
Dennis
I'm pretty new to Perl, but I'll try to tackle this one with what I know
so far....
First of all, I'm not sure about what you mean by "browse it online"; do
you want to store the content in a database? From my perspective your
question seems vague. You'll have to define that more precisely...
For the first half of your problem that I think I understand, I'll
assume you need information on using CGI coupled with sending e-mail. I
recently learned some of the basics of using Perl with the web through
Chapter 14 - Introduction to CGI, of "Beginning Perl", (3rd Ed.) by
James Lee. It's not complete (for example, lacks security
considerations), but the chapter reads like a tutorial and I found it
easy to follow along and build the example script at the end of the
chapter (webchess.pl). The book also refers the reader to "Official
Guide to Programming with CGI.pm" by Lincoln Stein (the module's author).
For "official" PerlDoc online documentation with an example, check out:
http://perldoc.perl.org/CGI.html#A-COMPLETE-EXAMPLE-OF-A-SIMPLE-FORM-BASED-SCRIPT
Working with the example above, the do_work() subroutine processes the
form parameters. You should be able to apply the same concept to your
problem, and have do_work() grab the posted data ( via the keys in the
param() method ) and output to an e-mail, using the Mail::Mailer module:
http://perldoc.perl.org/perlfaq9.html#How-do-I-send-mail?
http://search.cpan.org/~markov/MailTools-2.07/lib/Mail/Mailer.pod
Hope that gets you a start.
Brian
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/