Solved

Sending Multiple forms with PERL

Posted on 2001-07-02
7
233 Views
Last Modified: 2012-08-14
I have two forms.  Form 2 is a continuation of Form 1.  How to I use PERL to create code that will take data from BOTH forms and email it to me as ONE email.  This may take up to three forms to collect data to send via e-mail
0
Comment
Question by:MevaCat
  • 3
  • 2
  • 2
7 Comments
 
LVL 5

Expert Comment

by:amandeep
ID: 6246082
MevaCat,

I think u are not putting ur question clearly.
Here is my understanding :
- U have got 3 forms.
- First form is submitted then second form is displayed.
- Second form is submitted then the 3rd form is displayed.
- 3rd form is submitted then the entire information collected using the 3 forms are emailed to you.

Is the above correct?
Is there any url where I can see the forms?

Please provide as much details u can.
0
 

Author Comment

by:MevaCat
ID: 6248149
amandeep,

  You are correct.  Unfortunately I do not ahve the forms online yet.  It could be ANY three forms.  Form one is submitted and form 2 shows.  Form 2 is submitted and form 3 shows.  Form 3 is submitted and the data from all three forms is sent vial email to the customer.  I have tried to use Matt's FormMail but that only sends each form as it is submitted - NOT as one email but 3 separate emails

URL:home.hiwaay.net/~juricta/Lisa/mainpage.html
   Then choose Home Insurance.  There needs to be two more pages (not available yet)

The three forms are "fill in the blanks".  The info will be used to give the user a price quote on insurance options.  

Let me know if this is not enough info.
0
 
LVL 5

Expert Comment

by:amandeep
ID: 6253621
MevaCat,

I would suggest u to post the 3 forms required here.
Please specify what all contents of the forms are to be e-mailed and to whom.

Please provide as much details u can.

0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:MevaCat
ID: 6259167
The two forms are located at the URL shown below.  Click the Home button.  The next form originall had a "Submit" button to send the data via email.  I want to have a button that will open a second form (see "continue" link on 1st form).  This "continue" will send data from one to 2 (or place data in hold).  The submit button on form 2 will send data from BOTH forms via email

Each piece of data is sent via email to the recipient (currently me) and the recipient will "act" on thte data for a price quote.  The CGI script is Matt's FormMail script but it can only send ONE form at a time

http://home.hiwaay.net/~juricta/Lisa/buttons1.html
0
 
LVL 6

Expert Comment

by:andreif
ID: 6259516
Just use hidden field inside form nr. 2 to pass data from form nr.1,

so the result from form nr.1 submission is form 2 with some hidden data and the result of form 2 is a email with all data...

This process can be continued without any limits of forms quantity
0
 

Author Comment

by:MevaCat
ID: 6259541
andreif,
  Not sure what /how to do what you state.  Could you be a more specific?  An example of code?  Anything?
0
 
LVL 6

Accepted Solution

by:
andreif earned 100 total points
ID: 6259664
Something like this:

--------------------
Form1.html

<form action="mailer.cgi" method=post>

Field 1 <input type="text" name="field1">

<p><input type=submit>
<input type="hidden" name="step" value="1">
</form>

--------------------
Form2.html - this form should be generated by mailer.cgi when it get the first form results. You can identify first form by the hidden input "step" which value is 1

<form action="mailer.cgi" method=post>

Field 2 <input type="text" name="field2">

<p><input type=submit>

<!-- old data -->
<input type="hidden" name="field1" value="value of the field 1 placed here by the script">

<input type="hidden" name="step" value="2">
</form>

--------------------
mailer.cgi

# Parse form data into hash $in

if ($in{step} eq "1") {
  # print out form 2
} elsif ($in{step} eq "2") {
  # send form data to email
}

--------------------

As you can see, the field1 value filled in the Form 1 is inserted into Form 2 as a hidden field. After submitting Form 2 script get field1 as well as field2 and send it to email
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now