Simple Easy To Use PHP Spell Checker

General Info:

The program is used to spell check any of the input field of the HTML form. It is useful for webmasters who want to add spell checking to any text box (textarea) on their website or corporate intranet. The script is designed not to mess any way to your main script processing of the form. It just return modified (already spell-checked) text into any input field. It is written on PHP and using JavaScript as minimum as possible.

JavaScript code is limited to:

Download:

spellcheck-1.2.0.tar.gz - coming soon, will support mixed languages and bulletin boards where mixed contents is posted text + code

spellcheck-1.0.4.tar.gz   18 May 2006
(Main changes: work regardless of register globals and define places should be avoided during checking and preview - avoid HTML, BBcode, pasted Scripts... )

spellcheck-1.0.2.tar.gz
spellcheck-1.0.0.tar.gz

Live Demo:

Example Form.

How to Install:

1.Add SpellCheck link nearby entry field. Copy code and change javascript:SpellCheck() according to the name of the form and to the name of the input field.
In SpellCheck('proba','description_short') first var ('proba') is name of the form.
and second var 'description_short' is name of the input field

Example:
name of the form is:user_form
name of the input field is:comment

<FORM NAME="user_form" method="POST" action="somewhere.php">
<textarea name="comment">
</textarea><BR>

<a href="spell_check.php?init=nojs" onclick="javascript:SpellCheck('user_form','comment');return false;">SpellCheck</A>

<input name="submit" type="submit" value="Submit">
</FORM>


You may add spellcheck links not only on one input field, but on every field used in form. If your page contains multiple forms you can add spellchecking on them as well. Parameters passing to JS function SpellCheck() are needed by spell_check.php. The script(php) must know original place (form-field name) where to return the corrected text.

2.Copy the following JS code into the <head> </head> area of page where your form reside:

3.Copy the following HTML code in the page where your form reside:

4. Final Steps:
spell_check.php must reside in the same directory where your form is. If you copy in other dir, please change the path to the script in:
(a).hidden_form: <FORM name="hidden_form" method="POST"action="path_to_the_script/spell_check.php?init=yes"
and in
(b).spellcheck link: <a href="path_to_the_script/spell_check.php?init=nojs" onclick="javascript:SpellCheck( ....
Spelling of other language (not English) is also possible if it is aspell supported. To do this change the line $int = pspell_new('en'); with appropriate letter (
function.pspell-new). If you have any difficulties during the install and config I can offer free assistance via e-mail (or ICQ: 121014338 please write some 'spell check' words to the authorization subject). Any suggestions are welcome.

Requirements:

0.register_globals set ON (sorry) http://www.php.net/register_globals;   How to change PHP parameters when you don't have access to php.ini
1.aspell with appropriate dictionary
2.PHP with pspell compiled in

Check the output of phpinfo();
<?php
phpinfo();
?>
If all is OK you can see somewhere in the top:
'--with-pspell'
if not, you must recompile PHP add the line --with-pspell to ./configure
Note that pspell is not enabled by default in ./configure
Personally this is my configure:
./configure --with-apxs2 --prefix=/usr --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-cgi --enable-bcmath --with-pspell 
If you using RedHat/Fedora all this is set by default.

Check the installation:
rpm -qa | grep aspell
output:
aspell-devel-0.33.7.1-21
aspell-en-gb-0.33.7.1-21
aspell-0.33.7.1-21
and
rpm -qa | grep pspell
output:
pspell-0.12.2-16
pspell-devel-0.12.2-16

Bugs:

1.probably
2.probably Browsers incompatibility
3.correct my English
4.life it self

Please report success,bugs at E-mail: naka (at) 1001Line dot net


Simple, Easy to Use spell_check.php
Copyright (C) 2005 by Naka Gadjov
Design and Information www.1001line.net
The project is sponsored by
Trakia Real Estate and is used heavily during the database translation of the English version of the site.


If you like this script, place a link to www.1001line.com on your website.

OR to this page

This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; please refer to the GNU General Public License for details.