Forms

Note: the information on this page does not apply to web sites/pages created using the Interwoven Teamsite CMS, templates are provided in the CMS to create forms without coding.

iSolutions provides universal access to a script (called process_form) that allows the visitors to your web site to submit information to you via a HTML form. These forms can exist anywhere in your public_html directory. The results will usually be sent to the email account associated with the account from which the form originated.

Note that while forms are useful for collecting information, they should be used with caution. In particular, you must realise that there is no way by which the sender can be authenticated.

To receive the results from your form, you will need to use the HTML form tag listed below. Please note that method="post" must be used.

<form method="post" action="http://www.soton.ac.uk/cgi-bin/process_form">
...the body of the form...
</form>

Required and optional fields

Inside the body of your form, you must have three fields named 'subject', 'from-name' and 'from-email' - your forms will not work without these fields.

Each of these mandatory fields can be provided in one of two ways: as either a text input or a hidden input (with their values set by you to some default).

All as text inputs:

<input type="text" name="subject" />
<input type="text" name="from-name" />
<input type="text" name= "from-email" />

All as hidden inputs:

<input type="hidden" name="subject" value="Email from my site" />
<input type="hidden" name="from-name" value="A site visitor" />
<input type="hidden" name="from-email" value=mysite@soton.ac.uk />

If from-name and from-email are text inputs, they can not be validated on the client using JavaScript.

If you are using text inputs for any or all of these mandatory fields, you should also use label elements to present text labels for each of the inputs to your visitors (as you should for all the inputs on your form), in which case, you'll also need to add an id attribute to each input.

Although it is not required for the processing of the form, you really should confirm that the form has been submitted. This can be done using either one or other of 'next-url' or 'confirm-message' as a hidden input.

You can redirect users to another page after they have submitted your form by using next-url, e.g.:

<input type="hidden" name="next-url" value="/username/received.html" />

Where username is your username. Note: You can specify any page; received.html is merely an example.

Or, you can use confirm-message as in the following example:

<input type="hidden" name="confirm-message" value="Your message" />

Where "Your message" can be any message you choose.

Other fields

The process_form script can process data submitted using any other valid HTML form control. There are many excellent online tutorials that can teach you how to create all the different types of form inputs, three examples (from many) are Active Jump, Echo Echo and W3Schools. In addition, you may also wish to familiarise yourself the official recommendations for HTML forms direct from the World Wide Web Consortium.

Other options for form processing

Instead of using the process_form script, you may choose to create your own script with PHP4 to process form submissions on your site. PHP is a fairly easy language to learn and there are plenty of tutorials on the Internet to help you on your way, simply search for 'PHP tutorial' with your favourite search engine.

If you choose to write your own PHP scripts for your personal or club / society web site, you should be aware that iSolutions can only guarantee to ensure that the web server is correctly configured to run your scripts, help with writing and / or debugging PHP is provided only on a best-endeavours basis.