Using htmlArea and a Database to Maintain Content on a Website
(Page 1 of 4 )
If you wish to develop a website that others can contribute to, one option is to have text files sent as e-mail attachments, convert these to HTML and then upload the file. There is, however, a better way! If the people making submissions to your site are capable of using a word processor then things can be done much more efficiently. This article will show you how to use a free component called htmlArea and a database to handle the addition and display of content on your website. Some knowledge of HTML, databases and server-side scripts is assumed.
Introduction
htmlArea is a free WYSIWYG (what you see is what you get) editor created with Javascript. It can replace “textarea” fields in a web page, and using it is akin to using a word processor. Text can be manipulated by using buttons on a toolbar and options in “select” controls. Foreground and background colors may be changed, images inserted, fonts adjusted – all manner of text manipulation that you might expect from a word processor. When any changes are made to text, the appropriate HTML code is inserted. Press the “enter” key and a paragraph tag will automatically be inserted, the space bar and a non-breaking space is inserted, etc. A toggle button is provided that allows you to view the HTML source. You may also expand the control and open it in a separate window.
This item is available for free and may be downloaded from http://www.interactivetools.com/products/htmlarea/ - no strings attached and no trial period. You can even customize it if you want to. Have a look at a modified version of this control at http://www.webstationone.com/test/htmlarea/index2.html.
However, before going any further you should be aware that this component works only in Internet Explorer Version 5 or higher. This does not mean that your HTML code will not function if viewed in Netscape. It simply means that textareas will appear as textareas and will not be replaced by an htmlArea. A beta version with cross-browser functionality is in the works but still lacks documentation.
htmlArea is a very attractive and powerful component, but it’s only useful if its contents can be saved. This article will describe how to install this control and how to save and retrieve the HTML files that are created. Our solution will be implemented using PHP and MySQL though the principles will apply to any relational database and any server-side scripting language.
Next: Download and Install >>
More HTML Articles
More By Peter Lavin