4
well i havent found any info regarding this! just had a look at how it is appliedy in the register form and followed that logic
first thing to do is create the captcha object.
To do this you have to use the following code...(i applied this to the contact us module as stated in my first post, the following code was added in the contactform.php file to show the captcha image)
Quote:
xoops_load("XoopsFormCaptcha");
$cpatcha = new XoopsFormCaptcha();
$cpatcha->getCaption();
$cpatcha->render();
this includes it to the contact form object
Quote:
$contact_form->addElement($cpatcha, true);
then in the index.php file we want to check if the user has entered the correct letters...
to do so I added the following code..
//get the instance of the captcha object
Quote:
xoops_load("captcha");
$xoopsCaptcha = XoopsCaptcha::getInstance();
//check if the captcha is cool
Quote:
if ( !$xoopsCaptcha->verify() ) {
$error = $xoopsCaptcha->getMessage();
echo "";
redirect_header(XOOPS_URL."/modules/contact/index.php");
return false;
}
that's it actually! Didn't have to include any files or anything else! That did the trick! I hope this helps you out a lil bit!:)