Simple Easy To Use PHP Spell Checker

General Info:

The program is used to shell check any of the input field of html form. The script is designed not to mess any way to your main script processing of the form. It is just return modified (allready spell-checked) text into any input field. It is writen on PHP and using JavaScript as minimum as possible.

JavaScript code is limited to:

Download:

spellcheck-1.0.0.tar.gz

Life 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 thru SpellCheck() are needed to know 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:

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 and must recompile PHP add the line --with-pspell to ./configure
Note that pspell is not enable 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
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.