Build Secure forms for Drupal 6 using Mollom and Webforms
I was recently building out a new site using the latest version of Drupal 6 when the client requested a custom contact form. In Drupal 5, I had build a few custom forms - even a secure form using captcha. At that time there were some great tutorials and forum posts on how to set this up. This time I was surprised to come up with nothing when searching for a "how-to" for Drupal 6.
This led me to realize the need for a quick step by step guide based on a successful implementation of secure web forms using the latest available modules for my fellow drupal friends using the following modules:
I. Setup Mollom
- Download and enable the above modules.
- Create an account at Mollom.
- Activate your website. You will need the keys that are created here for configuration of the Mollum plugin on your site.
II. Create Webform
Webforms are unique and highly functional nodes. In fact, each form you create is a node. Submissions are attached to nodes and can be tracked via the webform tool. This makes setting up a little different from some other procedures.
- From Administration-->Site Configuration, select Webform.
- Select all appropriate field types needed for your form and save settings.
- From Administration-->Create Content, select Webform.
- Setting up a webform is very similar to creating other kinds of contents but with some important differences. After the form is created, there is additional configuration, but first, the basic form node needs to be created. Note the following settings which are specific to webforms:
- Confirmation message or redirect URL: Enter a friendly message here that will show up on submit -or- enter the url you wish to return the user to on this action.
- Roles that can submit this webform: Select the roles that submit.
- Email To Address: enter the email address where the submissions will be sent.
- Conditional Email Recipients: Chicken or Egg scenario - needs components set up first so you may want to revisit this nice little option to set different recipients based on certain conditions.
- Webform Advanced Settings: this group of settings let's you set limits on the number of submissions from an ip address (good anti-spam measure), any additional validation or processing and the text on the submit button.
- Set up your webform and save settings. For the next step (adding form components) you will now need to access and configure the webform you just created.
- From Administration-->Content Management, select Webforms.
- This page lists in a table all webforms created in the previous steps. Note that there are a number of options here such as View Submissions, Analysis, Table or even download. As mentioned earlier, all submission data is saved as attachments to nodes (webform). This provides a highly granular data set that can track and monitor form submissions. To continue setup, select the webform with the Edit link.
- Note the 'Form Components' link. Select that and on the next page add your form fields. The field types available are those selected in step 2.
- If clean URL's and Path module are enable, set the path for this module to make it easy to navigate to from another page or menu.
- Save your settings.
III. Configure Mollom
- From Administration-->Site Configuration, select Mollom. Enter keys created in Part I, step 3 and save. Note that forms will be listed here. Select the appropriate method for webforms and save settings.
Using Stats & Reports
Both of these modules offer great built-in reporting. Mollom displays spam activities on a nice ajax-y chart that you can monitor based on date range. Webforms adds a 'Results' tab to the form node for users with proper permissions. Part 2, step 7 mentions this functionality. This will give form administrators a great tool to monitor submissions.
That's about it - the rest is up to you.

