How to Make a Suggestion Box in an HTML Page
To implement a suggestion box on your HTML web page, you will need access to the cgi-bin directory of your website and the ability to change file permissions on your web server. A suggestion box is created using an email web form that contains one field for the text of the suggestion. No other fields are required unless you do not want the suggestion to be anonymous. In that case, you can add fields to collect an email address or name. If you use a web editing tool like Dreamweaver, you can do all this from within the editing tool.
Things You'll Need
- Web browser
- Website editing software (Dreamweaver recommended)
- Secure NMS FormMail script
Instructions
-
Customize and Upload the Mail Form Script
-
1
Download the free NMS FormMail Script from the Internet with your web browser. This script is more secure than other mail form scripts because it keeps the recipient's email address off the web page where spam bots can find it.
- 2
-
-
3
Open the FormMail.pl file in your web editing tool. You may need to use "File-->Open" instead of double-clicking on it if your web editing tool doesn't recognize the .pl extension.
-
4
Select "Save As" from the File menu to give the script file a new name like "SuggestionBoxHandler.pl" and save it in the cgi-bin directory of your local website.
-
5
Customize the variables at the top of the FormMail script in the User Configuration Section as directed in the FormMail instructions and as seen in the illustration here. Enter your domain name in the @refers array to ensure that only those who come through your website can use this script to send mail. Enter the email address to receive the suggestion box messages in the @allow_mail_to array. Both these variables prevent spammers from hijacking this script and turning your web server into a relay for their junk mail. Next to "From:" enter the display address the suggestion form should come from (usually your webmaster address).
-
6
Save changes and upload the script file to your web server.
-
7
View the files on your web server. With Dreamweaver you do this by selecting "Remote View" at the top of the files list on the right side of the screen.
-
8
Set the file permissions for the script to 755 so that it can run from the web page. In Dreamweaver you can do this by right-clicking the file in the list and choosing "Set Permissions" from the pop-up menu. If you are working at the system level of your web server, the UNIX command is "chmod 755 SuggestionBoxHandler.pl."
Create the Web Form and Thank You Page
-
9
Create a new HTML web page in your web editing tool and call it "SuggestionBoxThankYou.html" (or similar). Save it at the top level of your website.
-
10
Enter some text on this page that thanks the person who submitted a suggestion and includes your standard navigation or a link back to your home page. This page will appear in the web browser if the suggestion box web form submits successfully.
-
11
Open the web page that will contain the suggestion box or create a new HTML page for it with your web editing tool.
-
12
View the HTML code for this web page and insert the code you see in the figure here to create a web form with one text field that calls the NMS FormMail Script you just customized (SuggestionBoxHandler.pl). Notice the command for the redirect to the Thank You page. Customize your code to include your domain name and the filename for your Thank You page.
-
13
Save changes and upload this web page and the Thank You web page to your web server.
-
14
Use your web browser to view and test the page with the suggestion box.
-
1
Tips & Warnings
There are commercial services on the Internet that offer suggestion boxes for websites. You sign up for their service and they give you code for the web page that links to their website to process the form data. It's not a free solution, but if you are leery of working with a cgi script, this is an option.
Resources
- Photo Credit Catherine Chant