Solved

Script for auto-responder

Posted on 2003-11-29
6
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

624 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