Online
Manual / Setting Up
Your Forms / Multiple
Page Forms
You would
first need to specify the location of the templates.
Then you can proceed to creating the form pages. All <output>'s
will be converted in the forms. Let's show an example of setting up a
contact form.
Let's start
with the configuration file. Let's save it as config.txt.
| #
This is an example of a configuration file that can be used with
a multi page form.
# These are the required fields for page 1.
required page="1" value="Name, E-mail, Inquiry"
# We want to use sendMail in this
example.
sendMail value="1"
#
The template of all my form pages.
templatePage page="1" value="/server/path/to/contact.html"
# First
send the form results to myself.
sendMsg page="1"
to="Ollance.com <info@ollance.com>" from="ollance
<info@ollance.com>" replyTo="ollance <info@ollance.com>"
subject="Submission to your form from [output name='Name']"
template="/home/ollance/public_html/mailpro/templates/recipient.html"
contentType="text/html"
# Finally,
we can send an auto response to the user.
sendMsg page="1"
to="[output name='E-mail Address']" from="ollance
<info@ollance.com>" replyTo="ollance <info@ollance.com>"
subject="Thank you for submitting to our form [output name='Name']!"
template="/home/ollance/public_html/mailpro/templates/mailpro-php-response.html"
contentType="text/html"
|
Now let's
create our first page and save it as contact.html.
1
2
3
4
5
6 |
<form method="POST"
action="http://ollance.com/mailpro/mailpro.php?config.txt;currentPage=1">
<output type="results">
<input type="hidden" name="[name]" value="[value]">
</output>
<output type="error">
<p align="left">
Error:<br>
[error]
</p>
</output>
<table border="0"
cellpadding="0" cellspacing="5">
<tr>
<td>Name:</td>
<td><input type="text"
name="Name" value="[output name='Name']">
</tr>
<tr>
<td>E-mail:</td>
<td><input type="text"
name="E-mail" value="[output name='E-mail']">
</tr>
<tr>
<td>Inquiry:</td>
<td><textarea name="Inquiry"
rows="6" cols="40">[output name="Inquiry"]</textarea>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit"
value="Submit">
<input type="reset" value="Reset">
</td>
</table>
</form> |
- This line
tells browsers where the form data will be sent to. So we will need
to set the action to the URL location of the Ollance Mail Pro php program.
Notice the config.txt after mailpro.php? that is the name of the configuration
file stored in the home directory for templates and configuration files.
See Setting home directory for templates and configuration
files. Also, notice the currentPage=1 this tells the script that
the current page is the page specified in templatePage1.
Since we did not specify nextPage here the script will proceed to the
confirmation page and send
out an e-mail message since we added a sendMsg
command.
- We need
to carry on form results so we specify the form
results output type. It is required that you exclude fields that
have multiple values such as check boxes or menu lists.
- If an
error occurs it will display here.
- We add
the form fields 'Name, E-mail, Inquiry'.
- Since
this is the last page of our multi page form, we add a submit button
without a name to tell the script to proceed to the confirmation
page.
- This line
marks the end of the form.
Finally,
to view this form in a web browser we would go to:
http://example.com/path/to/mailpro.php?config.txt;currentPage=1
So please
make note of this when you create links to your form pages. |