Перейти к содержимому


Как прикрутить captcha к форме?


  • Вы не можете ответить в тему
В этой теме нет ответов

#1 GiantCherry

    Продвинутый пользователь

  • Assistent vsupport.club
  • PipPipPip
  • 75 сообщений
Репутация: 1
Начинающий
  • ГородСанкт-Петербург

Отправлено 28 January 2014 - 06:17 PM

подключил модуль faq, хочу к форме отправки вопросов прикрутить капчу. к форме добавил следующий код({*capthca*}):

<b>Добавить {if $answer}ответ{else}вопрос{/if}</b>

<form method="post" action="{if $smarty.const.CONF_MOD_REWRITE eq 1}faq.html{else}index.php?answer=1{/if}" name="formQuestion" id="formQuestion">

{if $answer}<input type="hidden" name="answerID" value="{$answer.answerID}">

{else}

<input type="hidden" name="answerID" value="0">

{/if}

<table cellpadding="0" cellspacing="0">

{if $error ne NULL}

<tr>

td colspan="2" style="color:red">{if $error eq 7}{$smarty.const.ERR_WRONG_CCODE}{else}{$smarty.const.FEEDBACK_ERROR_FILL_IN_FORM}{/if}</td>

</tr>

{/if}

{if $added == 1}

<tr>

<td colspan="2" style="color:green;padding:10px 0">

Ваше сообщение принято и будет опубликовано после проверки модератором

</td>

</tr>

{/if}

<tr>

<td valign="top" style="padding:5px 10px 5px 0">Представьтесь:</td>

<td valign="top" style="padding:5px 10px 5px 0"><input type="text" name="nick" value="{$dis_nic}" style="width:150%"></td>

</tr>


	<tr>

<td valign="top"style="padding:5px 10px 5px 0">Эл. почта:</td>

<td valign="top" style="padding:5px 10px 5px 0"><input type="text" name="email"  style="width:150%" value="{$dis_email}"></td>

</tr>

<tr>

<td valign="top" style="padding:5px 10px 5px 0">Вопрос:</td>

<td valign="top" style="padding:5px 10px 5px 0">

<textarea name="question" rows="3"  style="width:150%; font-size:12px">{$dis_text}</textarea><br>

</td>

</tr>


{*capthca*}
{if $smarty.const.CONF_ENABLE_CONFIRMATION_CODE eq 1}
		  <tr>
			<td style="height: 6px;"></td>
		  </tr>
		  <tr>
			<td align="left"><img src="index.php?do=captcha&amp;{php}echo session_name();{/php}={php}echo session_id();{/php}" alt="code"></td>
		  </tr>
		  <tr>
			<td style="height: 2px;"></td>
		  </tr>
		  <tr>
			<td align="left"><input name="fConfirmationCode" value="{$smarty.const.STR_ENTER_CCODE}" type="text" style="width: 220px; color: #aaaaaa;" onfocus="if(this.value=='{$smarty.const.STR_ENTER_CCODE}')
						{literal}
						{this.style.color='#000000';this.value='';}
						{/literal}" onblur="if(this.value=='')
						{literal}{{/literal}this.style.color='#aaaaaa';this.value='{$smarty.const.STR_ENTER_CCODE}'{literal}}{/literal}"></td>
		  </tr>
		  {/if}
{*capthca*}

</table>



<div class="button">
<a class="a_button" onclick="document.getElementById('formQuestion').submit();return false" href="#">Добавить</a>
	</div>


<input type="hidden" name="add" value="yes">	  
</form>

как теперь проверить капчу, где что нужно добавить?
  • 0