Introduction:
Quick Start

Using Forms To Go is easy. Here is a step by step guide for a quick script creation in PHP using the files provided in the Quick Start folder.

1 - Create your HTML form and result pages

For this quick start you won't create the required files, we'll use the files provided in the Quick Start folder: form.html, success.html and error.html

2 - Launch Forms To Go by double clicking it

3 - Load the HTML form into Forms To Go

Select the menu option Load HTML form... from the File menu.

and open the HTML form located in the Quick Start folder: form.html

4 - Verify the fields names

All the field names used in the form must appear in the main window of Forms To Go. If there is a syntax error with any field name, a message will appear on the screen, along with an alert symbol behind the field name.

Field names must be alphanumeric, that's only letters and numbers, and must begin with a letter.

5 - Select a validation for one or more fields

In our example form there are some mandatory values that must be filled correctly by the user to process the form. Here are our validation rules:

• First & last name field, firstlastname, must have between 3 and 36 chars
• Email must be a valid email
• User must repeat the email exactly to verify any typo
• Age must be between 1 and 99

Click on the firstlastname field and select a validation type number of characters and type 3 in the low limit box and 36 in the high limit box. For this Quick Start, don't worry about the Message to the user if validation fails checkbox.

Click on the email field and select validation type email address. This will check if the email address contains a valid syntax.

Click on the repeatemail field and select validation type equal to field, then select in the popup menu the field name you want to verify it's equal to: email

Click on the age field and select validation type numeric range and type 1 in the low limit box and 99 in the high limit box:

6 - Prepare the email that you'll receive with the form values

Select Email to form's owner... in the Settings menu. A window will show up allowing you to fill basic data about the email you will receive as the form's owner.

Select the email address to be used in the "From" field of the email. Since you're asking the user's email address in the HTML form, you can select this value to be used as the "From" of the email:

If you don't ask for the user's email address in the form, or your webhosting service provider limits you only to trusted domains in the "From", you can select Generic and then type a generic email address for your domain in the text box:

Insert as many To, Cc and Bcc email address you want to email. Click on the + button and add a destination email address. In the first column type the name and in the second column the email address:

Now, click on the Email toolbar icon to create the subject and body of the email. Forms To Go already created a body for the email, with all the field names tags and values. Feel free to modify this part of the email, add text, format it with spaces and symbols:

Click OK to close the window and save the email.

7 - Configure the result pages

After the user press the submit button in the HTML form, the script executes and must return a webpage to the browser, even if the field validation succed or fails. These webpages are the result pages.

The checkbox unchecked will work as redirect. For this Quick Start leave the box unchecked.

Since we opted to validate the input some fields, if any validation fails, like an empty firstlastname, the browser will be redirected to the error page and the email to the form's owner won't be sent.

If the validation succeed, then the user's browser will redirected to the success page and the email will be sent to the form's owner.

Select Result pages... from the Settings menu:

type success.html in the success page field and error.html in the error page field and press OK.

8 - Set the programming language settings

In this Quick Start we'll use PHP as the programming language, but the same principles applies for ASP and Perl.

Select PHP settings... from the Settings menu.

The form method must match the one in your form. In our Quick Start example, it's POST.

If you'll be uploading the script to a Unix server, select Unix as the End Of Line, otherwise select DOS/Windows if you'll be uploading your script to a Windows server.

Verify with your web hosting service provider which is the value of Register Globals, which is a security feature in PHP. If the PHP version of your webserver is 4.1 or higher, then leave Register Globals to Off. Otherwise, you must match your server configuration.

The most common PHP tags are <?PHP ...?> and 99% of the users will be fine with it, but some web hosting providers, for unknown reasons, limit the PHP tags to <? ...?>.

Press OK to close the window.

9 - Save your settings

Until now, we have selected some field validation options, we have configured the email we'll receive and modified some PHP settings. It's time to save all this settings values in case we need them in the future for this form.

Select Save settings as... from the File menu.

Type a name for your settings file and press Save.

10 - Create the script

We're ready to create our custom script for our Quick Start form. Select PHP in the main window and press create script.

If you followed all the steps correctly, no errors or warnings should appear and you'll be given the option to save the script. Save it with the name registration.php in the same folder Quick Start.

If you made any mistake, like a typo in the email address, or left the Subject of the email empty, you will see the error and you must fix it before creating the script.

11 - Modify the action tag of your HTML form

Now that you've created the script to process your form, you must indicate the HTML form which script it will execute when the user press the submit button.

If you're using a program like Macromedia Dreamweaver, Adobe GoLive or any other graphical web page editor, open the HTML form and edit the form properties. Type registration.php in the action tag:

If you're using a text editor, look for the line with the <form> tag:

<p align="center"></p>

<form name="form1" method="post" action="registration.php">

<div align="center">
<table width="500" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="181"><div align="right"><span class="style1">First &amp; Last name</span></div></td>
<td width="316"><input name="firstlastname" type="text" id="firstlastname">
*</td>
</tr>

12 - Uploading the HTML files and the script to your webserver

We're ready to upload the files and test the script.

By the way the result pages were configured, typing only the file names, without any directory or path to other place in the server, and the way we typed the script name in the action attribute of the HTML form, all the files must be located in the same directory in the server, other wise the HTML form won't find the script and the script won't find the result pages.

If your webserver hosting provider is strict about script location, to be placed on a specific folder, you must modify the configuration of the result pages, create the script again and modify the action tag of the form accordingly, with all the specific path names.

13 - Showtime: Test your script

After all files are uploaded to the server, invoke the form from the browser using your domain name, like:

http://www.MyDomain.com/form.html

A first test for the script is to press the submit button without type any char in the fields. Since many fields have validation selected, you should be redirected to the error page.

Now, press the back button to return to the form, and fill all the fields with correct values and press the submit button. You should be redirected to the success page and receive the email with all the field values.

 


More about introduction:

What's Forms To Go?
Features
Before you start
Quick Start
How to register Forms To Go?
Known issues and limitations

Index