Answer the question
In order to leave comments, you need to log in
How to fix captcha?
Good afternoon . I really need help, I broke my whole head. In general, there is a site on Bitrix, there is a section of vacancies, the client asked to put exactly the standard captcha on the resume submission form, without using a modular solution. Such are the things. In short, here is the code that I put in the template of this page
<?include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/captcha.php");
$cpt = new CCaptcha();
$captchaPass = COption::GetOptionString("main", "captcha_password", "");
if(strlen($captchaPass) <= 0)
{
$captchaPass = randString(10);
COption::SetOptionString("main", "captcha_password", $captchaPass);
}
$cpt->SetCodeCrypt($captchaPass);
?>
<form id="writeUs" method="post" class="zayavkaform">
<div class="zayavwrap">
<p>Введите код с картинки<span>*</span></p>
<input class="captcha _sid" name="captcha_code" value="<?=htmlspecialchars($cpt->GetCodeCrypt());?>" type="hidden">
<table>
<tr>
<td><input class="inptext" required="" id="captcha_word" name="captcha_word" type="text"></td>
<td><img class="captchaImg" src="/bitrix/tools/captcha.php?captcha_code=<?=htmlspecialchars($cpt->GetCodeCrypt());?>"></td>
</tr>
</table>
<div class="error-text"></div>
</div>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question