This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > February 2004 > Two questions about Form processing
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Two questions about Form processing
|
|
| theSquares 2004-02-29, 10:28 am |
| Hi!
I've created a registration and a contact form for my website, by which
visitors can send me their data and commets. I'd like to collect this data in
my mailbox, via a cgi-script called twomail.cgi. This script uses simple
..txt-templates which I am capable of making myself to gather the information
from visitors and send the data to myself, and a confirmation to the user who
filled in one of my forms. The textfiles must contain from-, to- and
subject-tags in the top of the file, and every field that I've used in my
html-page is accessible by using #[i]fieldname[/i]# tags. The links to the
templates are in the html-page in which I've used hidden fields,
[i]template[/i] (for recieving the data myself), and [i]template2[/i] (for the
confirmation. While testing I ran across some problems, and I hope you will be
capable of helping me out... Here goes:
a) In my registration form I have created several comboboxes for options that
allow the user to select multiple values. I'd like to recieve ALL values which
are checked, but I think I did something wrong. When I gave all the comboboxes
for a single question the same group name, and I used a #[i]group name[/i]#-tag
in the templates, I only recieve the lastchecked value of a checkbox. (ex. When
you create 5 comboboxes containing values from 1 to 5, every box with the same
group name, and you click 3 and 4 (in that order), all the template displays is
4 - because it was lastchecked.)
I would like to recieve all values, can anyone help me out?
b) Instead of sending plain text-templates to my visitors, I would like to
send them a html-page containing the 'thankyou-note', which looks a lot better.
I've tested a html-page with #-tags, and they work, but I don't know where to
place the from-, to-, and send-tags in order to recieve the mail. When I place
them beneath the <html>-tag, they don't work, and when I place them above, at
the top of the page, the html-page is not working correctly anymore.
Alternatively, I tried the needed tags for the script in the top of a textfile,
and the html-code of my page pasted below. This only works in e-mail-sites like
hotmail or yahoo, but not in outlook express for example. In programs like
outlook express the html-code is handled as plain text. Of course, when
everything works in e-mail-sites it's nice, but I wouldn't want to let
everybody who has outlook express or something similar down. Does someone know
a way of using html-pages as templates for my script, which will work correct?
Thanks in advance for any answers to my questions!
- Bart
| |
| Alan Ames 2004-02-29, 11:28 am |
| >via a cgi-script called twomail.cgi
a quick google turned up no info on that script, other than some old
readme's in Dutch.
On your combo-boxes:
Are they checkboxes or radio buttons?
If they are checkboxes, the script is handling the normal way. Few scripts i
know of are set to build an array of values from like-named checkboxes.
(phpformmail from boaddrink.com does, IF you put [] at the end of the
fieldname)
You would get all the results from the checkboxes if you gave each checkbox
a unique name.
On the html email, unless that is built into the script, you would have to
rewrite/modify the script so it sent an html email header, and put your
custimized body message into it it, using $fieldname like a mailmerge
variable statement to be replaced with the actual value. So it would all be
hard coded in the script, and specific to that exact form. One tweak to the
form to add something, and you'll have to modify the processing script to
match.
It may be way more than you need or want to tackle- but if you have to or
want to use Perl, this script will do what you want, sending out custom html
emails with the form data embedded in them.
http://soupermail.sourceforge.net/
It is not easy to understand the installation or setting up the templates. I
haven't used it in ages.
If you could use other scripting, there's other choices. PHP is easier to
install and modify for most folks that PERL scripts are.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|