|
The MagicForm is the most versatile
form manager
with the easiest to configure output.
The parts of a form are:
magicform.cgi
That is the form engine. Don't touch
that one.
Then you have the files that you do work with:
| Name of file |
* File Permission |
File Location |
sample.txt
This is the config or set-up file where you tell the form which
components to use |
666 |
in /magicform/formconf |
sample.html
That is the user input form |
644 |
anywhere |
sample.dat
Data file in which the submitted data is stored |
666 |
in /magicform/data |
sample.kb
Data file column set-up list. Here you tell it which fields
to store and in which order. |
666 |
in /magicform/data |
sample_mail_to_admin.txt
Plain text template for the mail that is sent to you whenever
a user fills out the form |
644 |
in /magicform/mail |
sample_mail_to_user.txt
Plain text template for the mail that is sent to the user whenever
she or he fills out the form |
644 |
in /magicform/mail |
sample_thankyou.html
Regular HTML page that thanks the user for filling out a form |
644 |
in /magicform/html |
How it works:
You can have as many sets of forms as you want. They can have totally
separate components, or they can share some components. For example
the Thank-You page could be shared by many of your forms.
In each form you have a line that starts with
<FORM ACTION...
The line after that looks similar to this:
<INPUT TYPE="hidden" name="config" value="sample">
The value in that hidden field, "sample"
in this case, determines WHICH config file is looked up to see which
components the form uses.
| Examples: |
<INPUT TYPE="hidden" name="config" value="sample">
The form will use the components that are listed in /magicform/formconf/sample.txt
|
<INPUT TYPE="hidden" name="config" value="survey">
The form will use the components that are listed in /magicform/formconf/survey.txt
|
<INPUT TYPE="hidden" name="config" value="xmas-order">
The form will use the components that are listed
in /magicform/formconf/xmas-order.txt
|
The config text file is VERY important. Please read the above part
until you completely understand what it does. Without that understanding
the forms will appear to be a complicated mystery. Once you understand
what it does, everything begins to make sense and will go easy.
That config file is a simple, plain text file, in this case called
"sample.txt". In there you see
for example:
| MAIL_USER|sample_mail_to_user.txt |
| MAIL_ADMIN|sample_mail_to_admin.txt |
| DATAFILE|sample |
| THANK_PAGE|thankyou.html |
It tells the form manager that whenever the "sample"
form is filled out, it should use "sample_mail_to_user.txt"
as the template for the receipt that is sent to the form submitter.
MAIL_ADMIN shows which template is used to send a mail to the admin
(you).
DATAFILE shows the name of the on-line data file and also the name
of the .kb file in which you specify the order in which the data fields
are stored in the data file.
By now you can probably guess what the last line is about.
File Permissions:
Just like all web programs, forms and their components require to
have certain file attributes or file permissions and are expected
to be in certain locations. In this list you see the file names,
the file attribute numbers, and the location.
| Name of file |
File
Permission |
File Location |
sample.txt
This is the config or set-up file where you tell the form which
components to use |
666 |
in /magicform/formconf |
sample.html
That is the user input form |
644 |
anywhere |
sample.dat
Data file in which the submitted data is stored |
666 |
in /magicform/data |
sample.kb
Data file column set-up list. Here you tell it which fields
to store and in which order. |
666 |
in /magicform/data |
sample_mail_to_admin.txt
Plain text template for the mail that is sent to you whenever
a user fills out the form |
644 |
in /magicform/mail |
sample_mail_to_user.txt
Plain text template for the mail that is sent to the user whenever
she or he fills out the form |
644 |
in /magicform/mail |
sample_thankyou.html
Regular HTML page that thanks the user for filling out a form |
644 |
in /magicform/html |
The number behind each of the files tells you what it's file attributes
have to be. Numeric file attributes are:
4 write enabled
2 read enabled
1 execute enabled
5 would mean read
enabled and execute enabled.
6 would mean write + read
7means write + read
+ execute
The first number in
654 is for OWNER (you, program)
The second number in 654
is for GROUP (program)
And the third number in 654
is for WORLD (visitors)
You can change the file attributes
with FTP or Telnet or Secure Shell.
What does each component do?
sample.html 644
This is a form page, the page that is filled out by the form submitter
or visitor.
You can copy it and save it under a new name and add more fields
and change what you want.
sample.kb 666
This file specifies which of the fields from the form are saved
in the on-line data file, and in which order. The data file can
be downloaded and imported into Excel. Consider each of the field
names the header of a column, and the values of that field in the
column below that header. For example you have in the kb file:
name|email|date|quant
The Excel spreadsheet file would then
look like this:
| name |
email |
date |
quant |
| Joe |
joe@aol.com |
2000/01/28 14:21 |
12 |
| Jim |
jim@aol.com |
2000/01/28 14:45 |
7 |
| Jane |
jane@aol.com |
2000/01/28 15:12 |
9 |
| Bill |
bill@hotmail.com |
2000/01/28/16:01 |
1 |
You don't have to store all the fields that you ask for in the on-line
data file. For example credit card numbers are sometimes not stored
on the server.
sample_mail_to_user.txt 666
edit with plain Text Editor
This file is a plain text template of the receipt that the form
sends to the submitter. If you write in that template: Dear <!--@name-->
then it will fill in the value that was submitted with the "name"
field. Just imagine what kind of smart auto-responders you can make
with that ! Send them a letter that has their name and other info
from the form sprinkled into it throughout the text.
sample_mail_to_admin.txt 666
edit with plain text Editor
This file is a plain text template for the report letter that you
get whenever a form is filled out. You can make that letter look
like the "Payment OK" letter that you will send them after processing
their credit card payment. That way all you have to do is blank
out the credit card numbers, and reply the letter to them. You can
put
into the FROM field in the template, that way when you hit CTRL
R in your email program, it will reply straight to the form submitter.
sample_thank_you.html 666
edit with plain Text Editor
This is the web page that is shown to the form submitter after filling
out and submitting the form.
sample_error.html 666
edit with HTML editor
This is the error page shown to the form submitter if they forget
a required field. The email field is ALWAYS required, any other
field can be made a required field by adding _req to the end of
the field name. Make sure you also add that to the field name in
the kb file!
sample.txt 666
edit with plain Text Editor
In the form page, for example sample.html, you see these lines:
<FORM ACTION="magicform.cgi" METHOD="Post">
<INPUT TYPE="hidden" name="config" value="sample">
The hidden config field tells the form to look for "sample.txt"
in the formconf directory. inside that sample.txt you see:
MAIL_USER|sample_mail_to_user.txt
MAIL_ADMIN|sample_mail_to_admin.txt
DATAFILE|sample
THANK_PAGE|thankyou.html
It simply tells the form which components to use whenever the config
is "sample" You can make similar config files for each different
form. Some of the form components are usable by all forms, for example
the last line, thankyou.html can probably be used for all your forms.
Some similar forms might also share the mail_to_admin.txt, but have
totally different mail_to_user templates. You simply specify here
which files a specific form will use.
An example would be the birthday form, wich has this command pair
in the form:
<FORM ACTION="magicform.cgi" METHOD="Post">
<INPUT TYPE="hidden" name="config" value="birthday">
birthday.txt could look like this:
MAIL_USER|birthday_mail_to_user.txt
MAIL_ADMIN|birthday_mail_to_admin.txt
DATAFILE|birthday THANK_PAGE|thankyou.html
sample.dat
This file is generated by the form and is the data file. If you
delete it, the form will generate a new one.
You can download the data file and import it into EXCEL. When EXCEL
asks you what to use for "Record Delimiter" use |
If your form does not work or gives you an error, all you have
to do is
1) panic, pull your hair out, yell and scream,
2) upload all the files that you listed in the config text file
3) correct the file attributes of the files you uploaded.
(Step 1 is optional and may be skipped)
Here is a summary list of the files with the file attributes.
You may want to print this part and keep it handy. For different
sets of forms, substitute "ssample" with the name of the
new form. You CAN share some of the components and use them for
more than one form set. The components that can be shared and also
used by other forms at the same time are marked with *
| Name of file |
File
Permission |
File Location |
sample.txt
This is the config or set-up file where you tell the form which
components to use |
666 |
in /magicform/formconf |
sample.html
*
That is the user input form |
644 |
anywhere |
sample.dat
*
Data file in which the submitted data is stored |
666 |
in /magicform/data |
sample.kb
*
Data file column set-up list. Here you tell it which fields
to store and in which order. |
666 |
in /magicform/data |
sample_mail_to_admin.txt
*
Plain text template for the mail that is sent to you whenever
a user fills out the form |
644 |
in /magicform/mail |
sample_mail_to_user.txt
*
Plain text template for the mail that is sent to the user whenever
she or he fills out the form |
644 |
in /magicform/mail |
sample_thankyou.html
*
Regular HTML page that thanks the user for filling out a form |
644 |
in /magicform/html |
*.dat and *.kb are a pair. If you
re-use one of them for a second entry form, you also have to use the
other one.
Have FUN! |