Before you start building this application, make sure you have a correctly configured Dreamweaver site, and a working database connection.
You will only have to create two files in your site's root. You can create them at the very beginning, so that you will not waste time with this operation again. To create files and folders in the site's root, use the corresponding options in the File menu of the Files tab. The file structure will look as in the example below, and you can create it easily by unpacking the zip file corresponding to your server model in your site root:

Figure 1. Site structure
The index of your site will display the contact form and perform most of the actions, while the thankyou.html page is only used to show a message to visitors that submit their messages.
After having created the files for your pages, it is time to set up the database to store the information for display. For this tutorial, you will use two tables: one for the departments, and one for the visitor's messages. The tables and fields are shown below:

Figure 2. Database structure
Note: The database diagram in the image above was built with Query Builder to better illustrate the database structure. You do not need to build it in order to complete this tutorial.
Here's a listing of the tables and columns used in this database:
You can find the script needed to create an identical table structure inside the attached samples, in the contact_form.sql file.
Note: The SQL code in contact_form.sql is for a MySQL database. If you are using another database server, or you want to try this tutorial on a different database, you will have to use a similar database structure.
Note: The departments stored in the department_dep table all have dummy e-mail addresses. To be able to see the sent message, you will need to replace them with real e-mail addresses.
Once you have created the index of your site, open it, and if you haven't already, create a database connection to the tables you've just created. Throughout this tutorial, the connection used will be called connForm.
After the connection has been created, you also need to setup the SMTP server to use for sending e-mails.
Note: For the PHP server model, if the SMTP settings have been set in the php.ini configuration file, this step can be skipped as the ones from php.ini will be used.
Having completed all of the prerequisites, it is time to move on and start building your application in the next section.