Elxis CMS Forum
Extensions => Components => Topic started by: 1050 on March 10, 2012, 09:23:14
-
Hi,
I want to use the Captcha in my registration form, But It always give me Captcha verificationerror . what's the problem?
It's the default code:
/* SECURITY CHECK */
if ($mainframe->getCfg('captcha')) {
$code = getEncString(trim( mosGetParam($_POST, 'code', '')));
if ($code != $_SESSION['captcha']) {
elxError(_E_INV_SECCODE, 1);
return;
}
}
I changed this line of the code :
$code = getEncString(trim( mosGetParam($_POST, 'code', '')));
to:
$code = getEncString(trim( mosGetParam($_POST, 'code')));
and It does'nt give that error anymore, I red about the third parameter of the mosGetParam and It said that the third one is optional, Is it work now? I mean doeas it check the captcha ?
thank you :)
-
If sessions are not properly setup on your web server captcha will not work as expected.
Do you see too many visitors in your site? Each time toy refresh the page does the number of visitors increase? If yes, sessions are not properly setup. The problem with session, usually, is that people do not set the session.save_path directive correctly in php.ini
-
I think It's not my session problem,cause now (with that change I 'made) when I enter the code wrong It gives me the error and when I enter it correct it accepts my registration, this means that the sessions work correctly, yes?
-
No, this is not the case. Read carefully what I wrote above.
-
I read that but the number of visitors does not increase! and there's a lot of session in my eshop, if my session didn't work probably, I had alot of problem!Anyway I will check my php.ini