We use cookies to ensure that we give you the best experience on our website. You can change your cookie settings at any time. Otherwise, we'll assume you're OK to continue.

Durham University

Computing and Information Services

Creating forms

If you are creating a WWW page, you may wish readers of your page to provide you with information. The HTML language contains a form construct for this purpose. A form consists of areas of the screen in which the reader of the page can input data. Having typed in this data, the reader presses a Submit button, and the data is emailed back to you.

Contact forms

For pages generated through the Content Management System there are several ways for users of the pages to contact the author. For personal and unofficial pages placed in public_html directories, there are two options for writing contact forms:

  • Write your own form handling code in PHP. This gives the most flexibility, but should only be attempted by people with strong existing PHP experience as it is very easy to introduce a security problem into these forms.
  • Use the CIS-supplied form handling software. Firstly, register a form account. This account will have a unique identifying number. Then, create a form on your web page (you can copy and edit the example code below to get started). The contents of that form will then be emailed to you when the form is submitted.
<!-- don't change this line -->
<form action='' method='post'>
    <!-- change '-1' on the line below to your unique form ID -->
    <input type='hidden' name='USERFORM' value='-1'>
    <!-- add the rest of your form fields here -->