R
R
rmfalx2017-11-23 14:14:18
CMS
rmfalx, 2017-11-23 14:14:18

How to add ReCaptcha 2.0 to any Joomla 3.0 form?

Standard features allow you to add a recaptcha to a standard feedback form or registration form.
I have my own feedback form and my own small php script that sends.
send.php

<?php
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$quest = $_REQUEST['quest'];
$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html;charset=utf-8 \r\n";

$message = "<p>Новый вопрос</p>
<p><strong>РРјСЏ:</strong> $name</p>
<p><strong>Email:</strong> $email</p>
<p><strong>Р’РѕРїСЂРѕСЃ:</strong> $quest</p>";

mail( "[email protected]", "Новая заявка",
    $message, $headers );
  header( "Location: http://xxx.ru/thankyou.html" );
?>

But the form itself
<div class="modal-header"><h3 id="myModalLabel">Заказать услугу</h3>
<div class="modal-body"><form action="send.php" method="post" class="form-horizontal">
<div class="control-group"><label for="tame" class="control-label">Ваше Имя</label>
<div class="controls"><input name="name" required="" size="30" type="text" class="name" placeholder="Ваше Имя" /></div>
</div>

<div class="control-group"><label for="telephone" class="control-label">Телефон</label>
<div class="controls"><input name="email" required="" size="30" type="text" class="validate-email" placeholder="Ваш телефон" /></div>
</div>

<div class="control-group"><label for="massege" class="control-label">Дополнительная информация</label>
<div class="controls"><textarea cols="30" name="quest" required="" rows="9" placeholder="Укажите здесь услугу, которую вы хотите заказать и площадь помещения"></textarea></div>

<div class="g-recaptcha" data-sitekey="6LcVyi4UAAAAACrZ7S4dS93YRXUO-B-uVolrp3BJ">&nbsp;</div>
<div id="recaptchaError" class="text-danger">&nbsp;</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Закрыть</button><input name="subscribe" type="submit" value="Отправить!" class="btn btn-primary" /></div>
</div>
<p><a href="http://xxx.ru">xxx.ru</a></p>
</form></div>

I have already generated all the keys. I connected the captcha to the form itself,
5a16ad5d03d5c389142061.png
but I can’t do the check in any way. Those. You can submit the form without captcha by clicking on the submit button.
Please help me connect.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question