Solved

Script for auto-responder

Posted on 2003-11-29
6
189 Views
Last Modified: 2013-12-25
My HTML "Subscription" form has a number of text fields, 2 list boxes (State & Country) and one radio button group. All fields, with the exception of 2 are 'required'.

I have written my CGI using Perl. The first part of the form rewrites to form if there are any 'required' fields that were not filled in. In rewriting the form, I have written script to retain any previously entered data in the forms fields. I have been successful at doing this for all fields but one; the radio button group.

QUESTION #1
The HTML is calling for no 'default' radio button. The subscriber is to select one and I want the script to rewrite the group, retaining the selected (checked) radio button.

___________________________

The rewritten page is designed to allow the subscriber to complete the required fields and the to resubmit the form.
A. A response screen is now written and displayed in the browser.
B. An auto-responder forwards a thank-you to the subscriber and
C. The form data is forwarded to my email address.

QUESTION #2
Problem: the autoresponderAND response to my email address is forwarded when submitted to the HTML form.  Therefore, if all fields are not conpleted, the auto-responder is still activated as is the response to my email address, providing me with only partial info.

There is probably an 'else' statement missing somewhere, but I can't seem to get it right.

HELP, before I finish pulling out my 56 year old hair.

THX!!
Jack

PS: If need be, I can forward the applicable script. There is really way too much to post here.
0
Comment
Question by:Happyjack
  • 3
6 Comments
 

Author Comment

by:Happyjack
ID: 9843941
Just a comment,
I have resolved the first question by looking at an earlier posted question by me some months ago. Guess I didn't learn my lesson :(

Anyway, the second issue is still up for grabs and I will keep it to 500 points even though I don't need the first question answered.

Here is the address for the subscription form:
http://www.phlebotomy-tutorial.html

I will post the cgi code in a few minutes
0
 

Author Comment

by:Happyjack
ID: 9844152
Okay, here is the link to the script:

http://www.phlebotomy-tutorial.com/subscribe.cgi.txt

Since there is no need to answer the first??, can someone pick up on what is most likely a very simple one.

Looking at the last 3-4 lines of code on my script, I am trying to provide a MAIL link to my web site. What is the format?

THANKS!!
Jack
0
 

Author Comment

by:Happyjack
ID: 9845943
SORRY!! :O
I noticed that the form address above is incorrect.
Try this:

http://www.phlebotomy-tutorial.com/subscribe-frm.html
0
 
LVL 1

Accepted Solution

by:
david_ross earned 500 total points
ID: 10136308
Just change "##else" on line 1406 to "else" and you should be ok.

I would also suggest using for loops and arrays for your country and states.  It makes your script much easier to manage.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 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