Solved

Script for auto-responder

Posted on 2003-11-29
6
186 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

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

14 Experts available now in Live!

Get 1:1 Help Now