As you surf the web, you will probably have noticed that most of them have some sort of facility for visitors to send a message to the webmaster. Some sites have a feedback or contact form, which is basically a form that you can complete and send using your web browser. Other sites have their contact information, like email addresses, displayed on a page on their site.
In this final chapter of the KompoZer Tutorial, you will be adding a feedback form to the site that you have created in the previous chapters. If you have arrived here from outside the site and wish to read the earlier chapters, you can find the first chapter at http://www.thesitewizard.com/gettingstarted/kompozer-tutorial-1.shtml On the other hand, if you arrived here looking for a feedback form script and not an KompoZer tutorial at all, you should go directly to the Feedback Form Wizard at http://www.thesitewizard.com/wizards/feedbackform.shtml to create your script.
Note that of all the chapters in this series of KompoZer tutorials, this chapter is probably the most difficult to understand, since it involves many unavoidable technical aspects. However, even if you don't understand portions of it, you should still be able to create a feedback form for your site by blindly following my step-by-step guide.
There are many aspects to getting a working feedback form on your website: it is definitely more than simply designing a web form with KompoZer. By way of overview, here are some of the major elements that we will need. You do not need to understand every single detail at this point since I will take you item by item through the whole process later. However, it is useful to have the big picture in mind so that you don't get lost in the forest of details later.
The first thing we need is the web page containing the feedback form. You will be designing most of this page using KompoZer. By itself, the form doesn't do anything at all: your visitors can click the "submit" button till they are blue and you will still not receive their message. The task of sending the form contents as an email message lies with what is known as the feedback form script.
The feedback form script is essentially a computer program that processes the contents of the form sent by your visitor's web browser. It takes the raw message and formats it as a regular email message and then sends it via email to the webmaster. This script has to run on the web host's server (ie, computer) itself. You will be using a script custom designed for you by thesitewizard.com's Free Feedback Form Wizard. However, you will have to find a web host that supports the running of such scripts yourself. Not all web hosts allow scripts to be run on their server (computer).
Next, we have the "thank you" page. After the browser sends the message to the script, you will want to thank your visitors for their email. Even if you don't feel particularly grateful, you will still need some sort of page that will inform your visitors that their message has been successfully sent. This page can be easily designed using KompoZer.
Finally, you will need an "error" page. If a visitor mistakenly clicks the "submit" (or "send") button before he/she has finished typing essential elements such as their email address, the feedback form script will direct them to a page telling them that they have missed out components required in a message. Like the "thank you" page, this is a straightforward web page that can be designed with KompoZer.
In other words, for your feedback form to work at all, you need five major things: the feedback form, the feedback form script (program), the thank you page, the error page, and a web host that allows you to run programs (scripts) on their computer.
Your feedback form will not work at all if you use a web host that does not allow you to run your own programs (scripts) on their computers. Basically, if you use the free web space provided by your Internet Service Provider (such as AOL), or if you use a free web host, you will not be able to get your feedback form working. Note that there are even some commercial (paid) web hosting that do not allow you to run your own scripts.
If you are looking for a suitable web host, you need to find one that supports the running of PHP scripts with an installed PHP that is version 4.2 or above. Generally, if a commercial web host supports PHP, their PHP version will satisfy this requirement. Do not use free web hosts, even if they have PHP support, since many of them do not allow PHP scripts to send email.
You can find a list of commercial web hosts at http://www.thefreecountry.com/webhosting/budget1.shtml. If you are curious as to which web host I use, you can find the information in my review at http://www.thesitewizard.com/archive/webhosting.shtml
The next thing you will need to do is to visit thesitewizard.com's Free Feedback Form Wizard to generate a customised feedback form script. The wizard can be found at http://www.thesitewizard.com/wizards/feedbackform.shtml
Read through the Wizard's introductory page. Choose to create the PHP feedback form script. Although you can generate any of the other types of feedback form scripts, for the sake of simplicity, this tutorial will only focus on the installation and creation of a feedback form that uses the PHP feedback form script.
In the next page, enter the information requested by the form. Modify the URLs supplied below to contain your real domain. For example, if your domain is "such-and-such-a-name.com", use that instead of the "example.com" given below.
Under the "Advanced Options (Optional)" section, click the drop down box for "HTML family to use" and select "HTML". (This step is optional, so it's no big deal if you can't be bothered to set it.)
Finally, read the licence agreement. If you agree to the terms, indicate it in the form, and click "Generate script" to continue.
Do not close the web page that appears. Leave it open while you work on the next few steps.
Start up an ASCII text editor without closing your browser. Windows users can simply start up Notepad, which is found in your Start menu. Click the Start menu, followed by the "Programs" menu item (or "All Programs" menu item if you use XP), the "Accessories" menu, then the "Notepad" menu item. If you are a Linux user, you probably already know what an ASCII editor is; for example, you can use "Kate", "vi, "emacs", or one of the million editors available on Linux. Mac users are on their own (sorry) since I have no idea what text editors are available on a modern Macintosh. It is important that you do NOT use a word processor like Office or Word or the like. If you are not sure where you can get an ASCII text editor, there are many free ones available for different platforms at http://www.thefreecountry.com/programming/editors.shtml
Switch to your web browser, and locate the section that has the header "Feedback Form Script". Select everything in the box below. If you are using Windows, one easy way is to simply click your mouse somewhere in the box and type Ctrl+A (hold down the Ctrl key and type 'a'). Then copy the text you have selected to the clipboard. You can use Ctrl+C in Windows, or use "Edit | Copy" from the browser's menu.
Switch back to your text editor, ie, Notepad if you are using Windows. Paste the contents you copied earlier. In Notepad, you can paste by using "Edit | Paste" from the menu. WARNING: Do not modify anything in this page. Do not attempt to beautify it. Do not even attempt to add a blank line. This is not the user-visible portion of your web page. We will come to that later.
Save the file as "feedback.php" and quit your editor. Important: if you are using Notepad on Windows, please save the file as "feedback.php" including the quotes. If you don't add the quotes, Notepad will save the file as "feedback.php.txt" behind your back.
To upload or publish the script so that it can be used by the pages on your website, you will need to use a program for transfering files, called an FTP client (FTP stands for File Transfer Protocol). KompoZer, up to version 0.7.10, does not seem to be able to transfer a script file that is associated with a form despite what its "Publish" dialog implies. Basically, you will need a separate FTP client to transfer ("upload") the "feedback.php" file from your computer to your web host's computer, so that it can be used by your website.
If you are using Windows, please refer to the following tutorial for instructions on how to publish the feedback.php file to your website: How to Publish or Upload Your Files to Your Website with FileZilla at http://www.thesitewizard.com/gettingstarted/howtoupload.shtml. Read the tutorial, follow its instructions, then return to this tutorial for the remainder of the steps.
Non-Windows users will have to look for an FTP client and find out how to use it to upload the feedback.php file to your web server. There are numerous free FTP clients available for many modern operating systems. You can find a list of them on the Free FTP and SFTP Clients and Free Download Managers page on thefreecountry.com.
By now, you should have no problem creating an ordinary web page. In fact, if you have been diligently doing the things mentioned in the previous chapter on multiple-column layouts, you will already have a four-page website (Home, About, Reciprocal Links, Site Map) with each page having a two-column layout.
Copy the layout from the other pages that you have created and create your navigation panel as before. If you are using the two-column layout from Chapter 4, put your cursor in the second column and type the heading "Feedback Form" (without the quotes). You can beautify it in any way you choose (for example, make it bigger, change the font, leave a blank line after it, etc). We will insert the feedback form generated by the wizard below that heading. If you are using some other layout, put the heading in the appropriate portion of the page.
Now switch to the browser window that contains the generated code from thesitewizard.com's wizard. This time locate the section in the output generated by the wizard that reads "HTML Code". Click in the box below and select and copy everything.
Switch back to KompoZer. Click in the space under the "Feedback Form" heading that you created earlier. Once you see your cursor blinking in the appropriate spot in the second column, click the "Source" tab at the bottom of the Window. The HTML code for your page will be displayed. Don't move the blinking text cursor and do not click anywhere in the HTML code portion. Select "Edit | Paste" from the menu to insert the HTML code given by the wizard in the current location.
Click the "Normal" tab at the bottom of the screen again to view your form. The form should be inserted in the correct portion of your page. You can now beautify your page any way you wish.
To widen the input field for "Name", click the field (the text-entry box) beside the words "Name:", and select "Format | Form Field Properties" from the menu. A dialog box will appear for that field (box). Click the button "More Properties" to expand the dialog box. The default field size as generated by the wizard is "25". You can increase it if you want the field to appear wider, or decrease it if you want it narrower. Note that this field size merely sets the appearance of the box on the screen. It does not affect how much text your visitor can type into the field. Most browsers will simply scroll the text if the box is not wide enough for what the visitor wants to type.
Simlarly, you can change the size of the box underneath "Comments:". Click the box, select "Format | Text Area Properties" and adjust the rows and columns to your satisfaction. As before, this change is merely cosmetic, and will not affect the amount of text your visitor can enter.
The text appearing on the button can be changed as well. Right-click the "Send Feedback" button. That is, click the right mouse button while your mouse cursor is over the "Send Feedback" button. A pop-up menu will appear. You can either ignore it and select "Format | Form Field Properties" from the main menu or simply click "Form Field Properties" from the pop-up menu that appears. The "Field Value" line in the dialog box that appears should display "Send Feedback", which is the text that is shown in the button on the form. Change it to some other text if you wish.
Do not change any value other than those I mentioned above. Most importantly, you should not modify the "Field Type" and "Field Name" values or the form will not work correctly.
When you have finished making changes, save your page as "feedback.html" with a title "Feedback Form". You can change the title if you wish, but you should leave the filename as "feedback.html" since this is the name you supplied to the Feedback Form Wizard earlier, and the script generated relies on it.
To create your "Thank You" and "Error" pages, start with the layout that you created for the other pages of your site and insert the navigation panel as usual. Then insert the appropriate text as outlined below.
The "Thank You" page typically thanks your visitor for sending his comments. Its main purpose is to provide feedback to the visitor that his comments had been successfully submitted. You can write anything you wish for this page. For example, you might want to say something like "Thank you for your comments. If your message requires a reply, I typically reply within 24 hours of the receipt of the message."
The "Error" page is shown whenever the visitor submits the form without filling one of the fields. For example, if he/she fails to enter an email address when the form is submitted, the "Error" page will be displayed instead of the "Thank You" page. Your error page should inform the visitor that he/she needs to complete all the fields in the form, and that he/she is to click the browser's "Back" button to go back to the form to repair the error. For example, a possible message that you can use for your "Error" page is "There were errors in the form that you submitted. Please complete all the requested information before submitting the form. Click the 'Back' button on your browser to return to the form to fix the error."
When you have finished designing your pages, publish them with KompoZer. If you have forgotten how to do so, you may want to read chapter 1 of the KompoZer tutorial again.
When all your files have been published, you should test your feedback form to make sure that it works. If something goes wrong, check the Feedback Form Wizard FAQ (Frequently Asked Questions) for the answer. You should also reread this chapter of the tutorial to see if you missed anything.
Congratulations! With this chapter, you have completed the basics of using KompoZer to design a website. You have also created a fully functional site, complete with main page, an "About Us" page, a "Reciprocal Links" page, a "Site Map" and a working "Feedback Form". More importantly, you now have the knowledge to use KompoZer to create, design and publish new websites as and when you wish.
If you want to do things with KompoZer that are not covered in this tutorial series, please check out the complete index of KompoZer tutorials. The index includes guides on other aspects of KompoZer not dealt with in this main tutorial, since not everyone will want (or need) to do those things. They also include troubleshooting guides for the occasions when something goes wrong and you don't know how to fix them.
Those of you who arrived at this KompoZer tutorial without reading How to Make / Create Your Own Website: The Beginner's A-Z Guide may also want to go back to that article to take a look at the other things that you may want to do. Creating a successful website involves far more than just the visual design of your website.
Finally, I would like to ask that you remember thesitewizard.com, even after you've completed your site. Link to it and recommend it to others. (Thanks!)
Do you find this article useful? You can learn of new articles and scripts that are published on thesitewizard.com by subscribing to the RSS feed. Simply point your RSS feed reader or a browser that supports RSS feeds at http://www.thesitewizard.com/thesitewizard.xml. You can read more about how to subscribe to RSS site feeds from my RSS FAQ.
This article is copyrighted. Please do not reproduce this article in whole or part, in any form, without obtaining my written permission.
It will appear on your page as: