Solved

Sending Multiple forms with PERL

Posted on 2001-07-02
7
242 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

11 Experts available now in Live!

Get 1:1 Help Now