Submission Action

Top  Previous  Next

After the visitor clicks the “Submit” button, the information he or she has entered must be somehow transmitted to FollowUpExpert. In order to do this, the form must send an email containing submitted information to an email address used by the right mailing list.

 

There are two general methods this can be done. One of the methods – mailto - requires no server-side script support and will work with any web server. Unfortunately, it has too many drawbacks to use it on a website. The other way is to use some kind of server-side script to send the message. In this manual we are only discussing submission that uses PHP scripting though you can, of course, use any scripting language supported by your web server or even the mailto method.

 

 

Submission Using PHP Script

 

Before you actually try to use this submission method, make sure that your web server supports PHP server-side scripting. If you are in doubt, contact the hosting company. If the web server does not support PHP, you will not be able to use PHP to send the submission results.

 

In addition to the HTML file that displays the web form, you need an additional text file (with a “php” extension) containing the PHP script. For example, this is a valid name for the file containing the script: “submit.php”.

 

This is how the HTML code of your form should look like if the name of the script is indeed “submit.php”:

 

<form action="submit.php" method="POST"> 

       HTML for the text, radio buttons, etc.        

</form>

 

Take a look at the “ACTION” attribute. It contains the name of the file containing the script.

 

What you need now is the script itself. Actually, you do not have to learn PHP at all! I created a flexible PHP script that works with any web form. You can download it using this link:

 

http://www.xtreeme.com/followupxpert/samples/sampleform.zip

 

To make it work with your web form, the script needs to be in the same directory as the HTML page containing the form.

 

Update the HTML code of the form to look like this:

 

<form action="submit.php" method="POST"> 

       <input type="hidden" name="submit_to" value="Mailing List Address">

       <input type="hidden" name="submit_subject" value="Message Subject">

       <input type="hidden" name="submit_successURL" value="Success URL">

       <input type="hidden" name="submit_failureURL" value="Failure URL">

 

       HTML for the text, radio buttons, etc.        

</form>

 

Replace Mailing List Address with the email address to which you want the PHP script to send the messages with submitted details. This must be the email address used by the mailing list configured to parse the message (see Parsing Messages Sent by a Form).

 

Additional thing you may want to customize is Message Subject. Replace it with whatever subject you want the message to have. If the mailing list you want to integrate with the form receives messages from other sources as well, you can use a special subject so that the mailing list can tell messages sent by the web form from other messages. To find out how you can filter incoming messages based on subject, read this section: Messages Matching User-Defined Conditions.

 

Replace Success URL and Failure URL with addresses of the pages you want the visitor to see after he submits the form. The first page (Success URL) opens when the submission is successful. The second page (Failure URL) – if due to technical difficulties the server cannot send the message.

 

Example:

 

 

<form method="get" action="http://www.FollowUpExpert.com/submit.php">

       <input type="hidden" name="submit_to" value="subscribe@yourdomain.com">

       <input type="hidden" name="submit_subject" value="subscribe">

       <input type="hidden" name="submit_successURL" value="http://yourdomain.com/thankyou.htm">

       <input type="hidden" name="submit_failureURL" value="http://yourdomain.com/error.htm">

 

       <table border="0" cellpadding="5px">

               <tr>

                       <td class="text">Name:</td>

                       <td align="right"><input name="name"></td>

               </tr>

               <tr>

                       <td class="text">Email:</td>

                       <td align="right"><input name="submit_from"></td>

               </tr>

               <tr>

                       <td colspan="2" align="right"><button type="submit">Submit</button></td>

               </tr>

       </table>

</form>