PDA

View Full Version : Auto fill in form details using CGI/Perl?


hellaby
11-28-2005, 05:54 PM
I am completely new to Perl/CGI coding and need someone to really help me by telling me (a) if what I'm trying to achieve can be done using CGI/Perl and (b) if so, help on how to achieve it. Here's what I want to do:

We're an art gallery and I want users of my website to be able to make an offer on any of the works of art for sale. I want them to be able to look at an item, click on a button and be directed to a form that comes up with the name of the artist and the item that they were just looking at atuomatically filled in for them. I want them to fill in their personal details below and then submit the form. The steps I think need to happen are as follows:

1. One form "The item they want to make an offer on" has to have two hidden fields in it named "artist" and "item". I want the values in these hidden fields to be submitted to the next form at the click of a button and to have the two values of "artist" and "Item" shown "automatically" on the new webpage. I want the customer to be able to see them.
2. The user then fills in his contact details below the fields that have "automatically" been filled in for him.
3. The submit button then needs to send all the data from the first and second forms to my email address.

I'm such a newbie to all this that if it is possible I would need to know the html/code required on each page and the script to make it happen. I've seen plenty of advice saying you need to parse this, parse that, use server scripting, etc, but nothing that actually shows you the code to achieve it. Can anybody help? I would be most grateful.

By the way, my ISP only operates CGI-Perl. No other options available. Although a total newbie, I can take instructions well!

nkrgupta
11-29-2005, 05:35 AM
(a) Every bit of whatever you require is easily and efficiently achievable by using CGI-PERL.
(b) Are you willing to learn it as your work gets done... Or just want the entire CODE written for you?
NMS FormMail Script (http://nms-cgi.sourceforge.net/scripts.shtml) is the de facto industry standard for form submission implementations ( at least for non coders) and it has a comprehensive documentation to get you started.

Get back in case of any queries.

Naveen

hellaby
11-29-2005, 05:59 PM
I am most certainly willing to learn and have downloaded latest version of Perl and am begining to go through the tutorials on perl.org. Unfortunately the brain is a little weary at the moment - I've had to teach myself how to use Dreamweaver, do java menus, apply css, set up a merchant account, find a gateway, etc in the last eight weeks just to get our site up and running. So I'm not picking perl up as fast as I would have liked to, or probably normally would. www.hellabygallery.co.uk is how far I've got on our site without the forms, if you want to take a look!

Added to this unfortunately my ISP - BT (British Telecom) doesn't automatically supply CGI bins for customer use and it's taken over three weeks to try and get them to enable this service on my domain! It's still not working properly and they have all sorts of things you can and can't do with the way sendmail is set up. Having lost all this time, I was hoping there might be a simple solution out there that would help make up for lost time!

Had a look at the site you suggested and have found many others as well. There's almost certainly one that will do the trick, it's just a matter of finding it! I think form2email looks like it might do the trick. If all else fails, I'll probably buy one of the multipage form packages that I've found in my searches and use them.