Uncaught in promise error recaptcha has already been rendered in this element

Error: ReCAPTCHA has already been rendered in this element when rendering page for second time #55 Comments If I render my page with the invisible captcha, everything works as expected. If leave the page (i.e. back-button) and come back to my page with the captcha, I get the error Error: ReCAPTCHA has already been […]

Содержание

  1. Error: ReCAPTCHA has already been rendered in this element when rendering page for second time #55
  2. Comments
  3. reCAPTCHA has already been rendered in this element. #7
  4. Comments
  5. reCAPTCHA has already been rendered in this element. #7
  6. Comments
  7. Ошибка с reCAPTCHA
  8. Ответы (1 шт):
  9. reCAPTCHA has already been rendered in this element about react-google-recaptcha-v3 HOT 3 OPEN
  10. Comments (3)
  11. Related Issues (20)
  12. Recommend Projects
  13. React
  14. Vue.js
  15. Typescript
  16. TensorFlow
  17. Django
  18. Laravel
  19. Recommend Topics
  20. javascript
  21. server
  22. Machine learning
  23. Visualization
  24. Recommend Org
  25. Facebook
  26. Microsoft

Error: ReCAPTCHA has already been rendered in this element when rendering page for second time #55

If I render my page with the invisible captcha, everything works as expected. If leave the page (i.e. back-button) and come back to my page with the captcha, I get the error Error: ReCAPTCHA has already been rendered in this element .

I am trying to use the captcha.reset() function, but it doesn’t seem to be doing what I expect. I have tried the reset() in multiple react lifecycle locations (componentWillMount, componentWillUnmount, render), but I’m still seeing the error.

I’m rendering the invisible captcha using this code:

The text was updated successfully, but these errors were encountered:

The problem is that DOM generated by this.props.grecaptcha.render() is not removed during ‘s unmount and therefore can cause trouble when rendering a new instance at the same place.

I can see two possible solutions:

  1. Implement componentWillUnmount to do following:
    • Remove all DOM generated by this.props.grecaptcha.render() including the render target element. (we don’t want to remove the div generated by React, so we probably want to manually add a wrapper div for this purpose)
    • Call grecaptcha.reset(widgetId) to do memory cleaning (as mentioned here and here)
  2. Detach rendered DOM inside componentWillUnmount and save it into some global variable for later reuse. This prevents the component from slow reloading after each use, however different instances may need different rendering parameters so this has to be taken into account.

@jhrdina yeah I think the first approach makes more sense. Would you have time to do a PR for this? I don’t currently have a lot of bandwidth, but will be happy to review & release.

Источник

reCAPTCHA has already been rendered in this element. #7

I’m using two components (signup and login) with ngx-captcha in each of these components.

Now when I’m trying to navigate between these two components (from signup to login), I get this «reCAPTCHA has already been rendered in this element» error.

I tried everything I could in ngOnDestroy in order to reset and reload the captcha in each of the components. Still getting the same error.

Other than that, everything is working just fine. Wondering if I’m doing something wrong?

The text was updated successfully, but these errors were encountered:

I’ve made some changes to the code, can you try updating to 2.2.0 ? Let me know how that works.

There was a minor bug with captcha id, try using 2.2.1

You’re awesome man!
The error is gone now. But sure, there is another one! 🙂
reCAPTCHA couldn’t find user-provided function: ngx_onload_callback_SOME_RANDOM_NUMBER

I’m not sure how that could occur. I was able to add multiple instances of captcha to my demo page without any issue. Can you try forking this repo and reproducing in the Demo application? Just fork + npm i + ng serve

I just added a navigation that tries to mock auth and redirects a user to another page.

Now, try to go to invisible recaptcha page with your console open and you will see the error that I’m talking about.

Thanks for that! Ah, I see what you mean. Though I’m not sure this is something I can fix on my end. The console log you see is coming from google script which says that the callback method could not be found. The thing is that Angular’s ngOnChanges is called before ngOnInit and so if you include captcha elem on page it will register the google script along with the callback and if you redirect before the google script has a change to initialize, the component will already be destroyed.

Is this causing you any issues? If not, I would leave it as it is. If it is, then maybe consider using *ngIf along with some condition on the ngx-captcha components so they are not registered until they are really needed.

It’s not causing any issues. I just wanted to know if it is indeed, an issue and whether I’m doing something wrong :/ Thanks for your great explanation and your excellent efforts for this project in here 🙂

Источник

reCAPTCHA has already been rendered in this element. #7

I’m using two components (signup and login) with ngx-captcha in each of these components.

Now when I’m trying to navigate between these two components (from signup to login), I get this «reCAPTCHA has already been rendered in this element» error.

I tried everything I could in ngOnDestroy in order to reset and reload the captcha in each of the components. Still getting the same error.

Other than that, everything is working just fine. Wondering if I’m doing something wrong?

The text was updated successfully, but these errors were encountered:

I’ve made some changes to the code, can you try updating to 2.2.0 ? Let me know how that works.

There was a minor bug with captcha id, try using 2.2.1

You’re awesome man!
The error is gone now. But sure, there is another one! 🙂
reCAPTCHA couldn’t find user-provided function: ngx_onload_callback_SOME_RANDOM_NUMBER

I’m not sure how that could occur. I was able to add multiple instances of captcha to my demo page without any issue. Can you try forking this repo and reproducing in the Demo application? Just fork + npm i + ng serve

I just added a navigation that tries to mock auth and redirects a user to another page.

Now, try to go to invisible recaptcha page with your console open and you will see the error that I’m talking about.

Thanks for that! Ah, I see what you mean. Though I’m not sure this is something I can fix on my end. The console log you see is coming from google script which says that the callback method could not be found. The thing is that Angular’s ngOnChanges is called before ngOnInit and so if you include captcha elem on page it will register the google script along with the callback and if you redirect before the google script has a change to initialize, the component will already be destroyed.

Is this causing you any issues? If not, I would leave it as it is. If it is, then maybe consider using *ngIf along with some condition on the ngx-captcha components so they are not registered until they are really needed.

It’s not causing any issues. I just wanted to know if it is indeed, an issue and whether I’m doing something wrong :/ Thanks for your great explanation and your excellent efforts for this project in here 🙂

Источник

Ошибка с reCAPTCHA

Из-за этой ошибки могут не работать другие js файлы?

Все контактные формы не автозаполняются при выборе адреса кроме той что находится в футере

Ответы (1 шт):

Теперь когда ошибки в консоли устранены, можно взяться за разбор происходящего.

Открываем dev tools, смотрим Event Listeners на форме на работающем сайте

Видим, что есть ссылка на 186 строку http://viniry.kz/wp-content/themes/eurodent/js/scripts.js?ver=20151215 . Там находится код обработки. Если туда поставить точку останова в браузере, при клике сработает точка останова.

На неработающем сайте такого обработчика (среди Event Listeners) вообще нет — проверьте это сами.

Почему так? В коде обработчика на картинке выше видим:

Клик должен быть по элементу input с name=group внутри элемента с классом contactform-wrap. У вас такого класс на проблемном сайте нет. Сравниваем:

Добавьте класс к элементу, и всё будет работать.

Можно сделать вывод, что контент сайта переносился руками, и некоторые классы элементов Visual Composer были потеряны. И вот тут мы возвращаемся к самому первому моему вопросу — как делали перенос сайта? и убеждаемся, что с самого начала я вам не «мешался», и не «говорил не по теме», а указывал на первопричину ваших проблем.

Уверен, что из-за неправильного переноса у вас ещё не один косяк вскроется. Переносите сайты правильно, с использованием Duplicator, и вы избежите массы подобных проблем.

Источник

reCAPTCHA has already been rendered in this element about react-google-recaptcha-v3 HOT 3 OPEN

Having the same issue when trying to define container prop.

👉🏻 Can’t container.element be dynamic at all?

Otherwise, the prop doesn’t make sense since DOM is yet to be ready when the GoogleReCaptchaProvider is triggered.

blekmus commented on January 16, 2023

I’ve been using this in a Nextjs setup. This error occurs when I’m in development mode. When I build and serve the application, there’s no problem. The error is not given and the captcha widget attaches itself to the element.

StigoSvK commented on January 16, 2023

I have the very same issue. Error is happening because of Strict mode which should not be ignored. At the and I decided to not use recaptcha badge at all. See https://developers.google.com/recaptcha/docs/faq#id-like-to-hide-the-recaptcha-badge.-what-is-allowed

  • Iframe AODA compatibility
  • executeRecaptcha not loaded
  • ReferenceError: process is not defined HOT 2
  • Don’t know what to do after sending token to backend and getting score from backend. HOT 2
  • Property ‘container’ does not exist on type ‘IntrinsicAttributes & IGoogleReCaptchaProviderProps’. HOT 1
  • recaptcha still return token even when offline HOT 1
  • release changelog HOT 2
  • Recaptcha causing page rerendering HOT 1
  • Please create tags for the new releases published on npm 🙂 HOT 1
  • [BUG] The commit «Fix issue with script reload on provider rerender with `scriptProps` present» introduces a regression on my product HOT 2
  • Make Too much complex
  • documentation for Example of refreshReCaptcha option
  • Reduce package size
  • How to access the vanilla `onload` function? HOT 1
  • Default value for action parameter HOT 1
  • Load script only on one page instead of all pages. HOT 2
  • Prop to change theme without change the default element
  • window[C[1]][C[0]] is undefined when navigating to the page with reCaptcha using nextJs router
  • Question about steps after getting token HOT 2

Recommend Projects

React

A declarative, efficient, and flexible JavaScript library for building user interfaces.

Vue.js

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Typescript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

TensorFlow

An Open Source Machine Learning Framework for Everyone

Django

The Web framework for perfectionists with deadlines.

Laravel

A PHP framework for web artisans

Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

javascript

JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

Some thing interesting about web. New door for the world.

server

A server is a program made to process requests and deliver data to clients.

Machine learning

Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

Visualization

Some thing interesting about visualization, use data art

Some thing interesting about game, make everyone happy.

Recommend Org

Facebook

We are working to build community through open source technology. NB: members must have two-factor auth.

Microsoft

Open source projects and samples from Microsoft.

Источник

0 Пользователей и 1 Гость просматривают эту тему.

  • 9 Ответов
  • 3097 Просмотров

Здравствуйте.
При включении встроенного плагина CAPTCHA — reCAPTCHA возникли проблемы с отображением в отдельных браузерах — в гуглхроме, Opera и Яндекс.браузере. При нажатии на кнопочку «Я не робот» она крутится бесконечно, и ничего не происходит. Соответственно, ни комментарий невозможно оставить, ни письмо в обратной связи написать.

В Мозиле, а также на смартфоне (Андроид) все работает нормально.

Рекапчи от Google на других сайтах в гуглхром, Opera и Яндекс.браузере отображаются нормально — при нажатии на «Я не робот» появляется зеленая галочка. Проблема только с моим сайтом.

Прошу подсказать, в чем может быть проблема.

сайт — http://st-anastasia.ru
Joomla 3.9.0
PHP 7.1.15
Версия CAPTCHA — reCAPTCHA установлена в настройках плагина 2.0. Ключи все есть. Но судя по тому, что в одном браузере работает, а другом нет, дело не в этом.
До этого пользовалась только кCAPTCHA в компоненте Jcomments, но последнее время посыпалось много спама в комментариях. Решила поменять.

В консоли конфликтов нет?

Записан

SEO-оптимизация,продвижение
Создание и сопровождение сайтов на Joomla
Миграция

Ну наверно есть, но я в этом ничего не понимаю.

Еще и на планшете посмотрела — все работает на планшете. Только на компе не работает.

Если подскажите, что надо посмотреть, я посмотрю.

« Последнее редактирование: 18.11.2018, 23:57:32 от k-redactor »

Записан


« Ответ #4 : 19.11.2018, 00:28:12 »

« Последнее редактирование: 17.07.2019, 16:27:29 от Support »

Записан

Ctrl+shift+I

Пишет такое вот. Это в Яндекс.браузере:

This page includes a password or credit card input in a non-secure context. A warning will be added to the URL bar in Chrome 56 (Jan 2017). For more information, see https://goo.gl/zmWq3m.
Refused to load the script ‘https://www.gstatic.com/recaptcha/api2/v1542004393985/recaptcha__ru.js’ because it violates the following Content Security Policy directive: «script-src ‘nonce-MDHs0+m89ZVUMxxILUIV016HHDE’ ‘unsafe-inline’ ‘strict-dynamic’ https: http: ‘unsafe-eval'». ‘strict-dynamic’ is present, so host-based whitelisting is disabled.
Uncaught [object DOMException]
Uncaught (in promise) Timeout (f)

ну и там ссылки на http://www.google.com/recaptcha/api2…. и т.п.

В Opera вот это:

Uncaught SyntaxError: Unexpected token ILLEGAL
recaptcha__ru.js:591 Uncaught Error: reCAPTCHA has already been rendered in this element
undefined:1 Uncaught (in promise) DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
undefined:1 Uncaught (in promise) DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
undefined:1 Uncaught (in promise) Timeout (f)

В Chrome вот это:
Uncaught Error: reCAPTCHA has already been rendered in this element
Uncaught (in promise) DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
Uncaught (in promise) Timeout (f)


« Ответ #7 : 19.11.2018, 07:14:37 »

« Последнее редактирование: 17.07.2019, 16:26:44 от Support »

Записан

Ну уж скорее обновить браузер — проблема только с хромиумами на XP, которые больше не обновляются. На всех остальных компах, где 7 и выше, ноутах и смартфонах все нормально. К тому же, меня ведь волнует не то, как я вижу, а чтобы посетитель увидел. Не буду же я всем предлагать откатить браузер, кто с XP заходит.

Про патч я ничего не знаю, у меня про патчи в консоли ничего не было написано.

SSL сертификат не сильно нужен — сайт маленький, никаких данных не собирает, регистрация отключена. Только комментарии и «написать письмо» с вопросом. SSL хостер только за деньги предлагает. Год был бесплатный, я пробовала, не понравилось — очень все тормозит, и платно уже отказалась.

Другую каптчу — в смысле не от Google? Или ключи другие? Пробовала другие ключи. Заново завела каптчу специально для V2.0. Все тоже самое.

Других предложений нет?

Неа, тут ничего не сделаешь.

  • Hi –

    I have 2 SIB forms in use on my site using this plugin. They are both using reCaptcha, and as a result I am getting the following error in the console:

    Uncaught (in promise) Error: reCAPTCHA has already been rendered in this element

    On the example page provided – One form is in the sidebar, the other in the footer – same content, but different forms with unique IDs.

    Is there a suggested solution for this issue please?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 5 replies — 1 through 5 (of 5 total)

  • Plugin Support
    Dulé

    (@lephenixdelafamille)

    @richt99

    The problem is that you have two forms using ReCaptcha on your page, which creates a conflict.
    There are two non-ideal solutions to solve this problem:
    1) You host the newsletter form on a different page of your WordPress, avoiding the conflict.
    2) Or you can create a form in Sendinblue, and embed it with the Iframe format. this format won’t conflict with the ReCaptcha as Iframe is a page within a page.

    I pinged our tech team to properly address the issue with future updates.

    Hi – Thanks for responding. Neither of these solutions are ideal as you have said.

    What SIB devs should do is to just give the container div of the Recaptcha element in each form a unique ID (e.g. it could just be based on the ID number or name of the form), and amend the following line accordingly:

    var recaptchas = document.querySelectorAll('div[id=sib_captcha]');

    This wouldn’t have any negative effect to the amount of code being used, and it should be very simple to implement.

    Hi, just here to report exactly the same issue.

    Not only can there be multiple Sendinblue forms with reCAPTCHA on a page, but there may also be Contact Form 7 forms on the page, which has official Sendinblue integration and also includes reCAPTCHA (so a third instance of reCAPTCHA snippet on the page).

    Please pass this information to your tech team to fix. Your plugin should definitely support this.

    Plugin Support
    Dulé

    (@lephenixdelafamille)

    hey @alecrust and @richt99 thanks for your feedback. Our tech team is on it in the current sprint.

    I assume this issue breaks reCAPTCHA too.

    Since moving from Contact Form 7 forms (with official Sendinblue integration, and reCAPTCHA v3 enabled) to Sendinblue WordPress forms (with reCAPTCHA v3 enabled) I get spam sign ups added to my contacts.

Viewing 5 replies — 1 through 5 (of 5 total)

  • The topic ‘Multiple forms on same page – Uncaught (in promise) Error: reCAPTCHA has already’ is closed to new replies.

:(
:cry:

Подключаю скрипт гугл каптчи

Код
<sc ript class="g-recaptcha-script" src="https://www.google.com/recaptcha/api.js onl oad=onloadCallbackGoogleRecaptcha&render=explicit" async defer></sc ript>

В шаблон формы вставляю html

Код
<div class="g-recaptcha-dynamic-initialized" id="g-recaptcha-dynamic-initialized1"></div>
еще одна форма
<div class="g-recaptcha-dynamic-initialized" id="g-recaptcha-dynamic-initialized2"></div>

Таких форм несколько и гугл каптч будет тоже несколько

Теперь запускается функция: onloadCallbackGoogleRecaptcha

Код
var allCapthaForms = new Array()
 var onloadCallbackGoogleRecapt cha = function() {
            var wss = document.getElementsByClassName('g-recaptcha-dynamic-initialized')
            Array.prototype.filter.call(wss, function(ws, i){
                id = ws.getAttribute('id')
                w=grecaptcha.render(id, {
                    'sitekey' : '<?=RE_SITE_KEY?>',
                })
                allCapthaForms.push(w)
            });
        };

Что она делает: инициализирует гугл каптчи и запоминает widget_id в массив allCapthaForms

Затем когда форма отправляется на сервер, через ajax, форма перезагружается и иницилазированная капча пропадает, ее нужно инициализировать заново, для этого написал это:

Код
var resetAllCapthaForms=function () {
            allCapthaForms.forEach(function (item) {
                grecaptcha.reset(item)
            })
            onloadCallbackGoogleRecaptcha()
        }

здесь я пытаюсь перебрать массив allCapthaForms и сделать grecaptcha.reset(item) каждой капчти, а затем снова запустить рендеринг функцией onloadCallbackGoogleRecaptcha()

НО! Все работает если форма одна! Но если форм больше одной, то я получаю ошибку:

Код
recaptcha__ru.js:596 Uncaught Error: reCAPTCHA has already been rendered in this element
at Object.$l [as render] (recaptcha__ru.js:596)
at (index):2393
at HTMLCollection.filter ()
at onloadCallbackGoogleRecaptcha ((index):2391)
at resetAllCapthaForms ((index):2403)
at :2:9
at Function.BX.evalGlobal (kernel_main_v1.js?1549274874311659:15)
at Function.BX.evalPack (kernel_main_v1.js?1549274874311659:15)
at parent.bxcompajaxframeonload ((index):98)
at kernel_main_v1.js?1549274874311659:23

Как я понимаю функция grecaptcha.reset(item) сбрасывает только первую форму. А остальные не хочет. На всех сайтах только и пишут про эту функцию а в качестве параметра ей передавать widget_id что я и делаю. Или что то все таки упускаю?

10 / 10 / 2

Регистрация: 29.05.2011

Сообщений: 533

1

29.05.2019, 13:55. Показов 3335. Ответов 8


Доброго времени суток!
Существует проблема с рекапчей.
На одной странице есть 2 формы.
Первая форма bitrix:main.feedback. В ней гугловская рекапча работает
Вторая форма altasib:feedback.form. Рекапча не срабатывает. А точнее пишет «Поле проверки на робота должно быть заполнено.». Хотя никакого поля дополнительного нет.
В консоли есть ошибка: VM2016 recaptcha__ru.js:610 Uncaught Error: reCAPTCHA has already been rendered in this element

Подскажите, пожалуйста, каким образом возможно исправить ошибку.

Причем в altasib:feedback.form даже капча от Битрикса не работает. Ошибка: «Введён неправильный защитный код». Хотя код введен верный.

Подозрение, что это конфликт модлулей, т.к. для капчи установлен модуль «reCaptchaFree». Но ведь в одной форме капча работает…

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

29.05.2019, 13:55

Ответы с готовыми решениями:

Вставка reCaptcha
Необходимо вставить reCaptha, ставить надо вручную. Вопрос такой, какие стандартные пути в файлах…

ReCAPTCHA внедрение. Как подключить reCAPTCHA от Google
Здравствуйте!
Нашел интересный обработчик формы обратной связи, переписал. Работало нормально, но…

recaptcha
Вставил на страницу код по образцу:
&lt;!— … your HTML content … —&gt;

&lt;form action=&quot;&quot;…

ReCaptcha
Реально как то получить/разгадать капчу на этих сайтах?:
http://beta.samp-rp.ru/аккаунт…

8

30 / 26 / 3

Регистрация: 01.09.2018

Сообщений: 141

29.05.2019, 15:11

2

https://developers.google.com/… cs/display
Note: your onload callback function must be defined before the reCAPTCHA API loads. To ensure there are no race conditions:



0



_marisha

10 / 10 / 2

Регистрация: 29.05.2011

Сообщений: 533

30.05.2019, 06:19

 [ТС]

3

stanislavj, спасибо что откликнулись.
В header прописано:

PHP
1
 <script src="https://www.google.com/recaptcha/api.js?" async defer></script>

После чего при отправке через форму altasib:feedback.form. Рекапча не срабатывает. А точнее пишет «Поле проверки на робота должно быть заполнено.». Хотя никакого поля дополнительного нет.
В консоли ошибка: Uncaught Error: reCAPTCHA has already been rendered in this element

Добавлено через 11 минут
В файле form.php altasib:feedback.form судя по всему происходит работа с рекапчей:

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if (isset($arResult["SITE_KEY"])):?>
                        <div class="afbf_item_pole required is_filled">
                            <div class="afbf_name"><?=GetMessage("ALX_TP_MESSAGE_RECAPTCHA")?><span class="afbf_required_text">*</span></div>
 
<?                  if($fVerComposite) $frame2 = $this->createFrame()->begin('loading... <img src="/bitrix/themes/.default/start_menu/main/loading.gif">');?>
                            <div class="afbf_pole_captcha">
                                <div class="g-recaptcha" id="html_element_recaptcha_<?=$ALX?>" onload="AltasibFeedbackOnload_<?=$ALX?>()" data-sitekey="<?=$arResult["SITE_KEY"]?>"></div>
                                <span class="afbf_captcha_reload" onclick="grecaptcha.reset();return false;"></span>
                            </div>
 
                            <script type="text/javascript">
                            var AltasibFeedbackOnload_<?=$ALX?> = function(){
                                grecaptcha.render('html_element_recaptcha_<?=$ALX?>',{'sitekey':'<?=$arResult["SITE_KEY"];?>',
                                    'theme':'<?=$arParams["RECAPTCHA_THEME"];?>','type':'<?=$arParams["RECAPTCHA_TYPE"];?>'});
                            };
<?                          if($arParams['ALX_LINK_POPUP']=='Y'):?>
                                $.getScript('https://www.google.com/recaptcha/api.js?onload=AltasibFeedbackOnload_<?=$ALX?>&render=explicit&hl=<?=LANGUAGE_ID?>')
                                  .fail(function( jqxhr, settings, exception ) {
                                    console.log('Error loading google :)')
                                });
<?                          endif?>
                            </script>
 
                            <div class="afbf_error_text"><?=GetMessage("ALX_CP_WRONG_RECAPTCHA_MIR")?></div>
<?                  if($fVerComposite) $frame2->end();?>
                        </div>
<?                  endif;?>



0



30 / 26 / 3

Регистрация: 01.09.2018

Сообщений: 141

30.05.2019, 09:41

4

ты бы лучше ссылку написала на сайт



0



_marisha

10 / 10 / 2

Регистрация: 29.05.2011

Сообщений: 533

04.06.2019, 13:57

 [ТС]

5

Через форму, на которой установлена рекапча происходит спам.
Видимо рекапча не поможет…
Найдена :
1. В форме нужно добавить <?=bitrix_sessid_post()?> — создает скрытое поле со значением равным id сессии текущего пользователя. — в форме уже есть <?=bitrix_sessid_post()?> и скрытое поле <input type=»hidden» name=»PARAMS_HASH» value=»<?=$arResult[«PARAMS_HASH»]?>»>
2. В обработчике в начале проверяем

PHP
1
2
3
if(!check_bitrix_sessid()){
    die("ACCESS_DENIED");
}

а дальше уже остальные манипуляции с запросом

Второй пункт не совсем понятен. Подскажите, пожалуйста, что имеется ввиду по «в обработчике»? Спасибо.



0



8 / 16 / 2

Регистрация: 15.06.2015

Сообщений: 247

05.06.2019, 05:28

6

Цитата
Сообщение от _marisha
Посмотреть сообщение

Подскажите, пожалуйста, что имеется ввиду по «в обработчике»?

Данная функция проверяет сессию…Вроде как пишут, что это некая защита от ботов…
И если с сессией проблема какая-то, то доступ будет запрещен.
Видимо чтобы не было спама от ботов через форму вашу.

Добавлено через 1 минуту
А вообще попробуйте написать в altasib.ru
Это же их компонент глючит с рекапчей, пусть решают.



0



30 / 26 / 3

Регистрация: 01.09.2018

Сообщений: 141

05.06.2019, 08:14

7

там обычная капча стоит уже, через нее я так понимаю и ходит,
для гугловской надо было рендер вызывать для первой и для второй формы по разным dom-узлам



0



_marisha

10 / 10 / 2

Регистрация: 29.05.2011

Сообщений: 533

05.06.2019, 08:21

 [ТС]

8

Цитата
Сообщение от Phobos92
Посмотреть сообщение

А вообще попробуйте написать в altasib.ru

— в том то и дело, что спам приходит не с формы altasib.ru, а с bitrix:main.feedback
Были попытки сделать рекапчу от гугла, ничего не получилось. Спам все равно шел с формы bitrix:main.feedback.
Сейчас вернули обычную капчу.
Вот теперь думаю как победить bitrix:main.feedback.

Цитата
Сообщение от stanislavj
Посмотреть сообщение

там обычная капча стоит уже

— верно, в bitrix:main.feedback уже стоит обычная капча.
Просто везде пишут что можно добавить скрытое поле и делать проверку на заполненность.
Не могу до конца сообразить как сделать.
В форме bitrix:main.feedback уже есть скрытое поле

PHP
1
2
<input type="hidden" name="PARAMS_HASH" value="<?=$arResult["PARAMS_HASH"]?>">
    <input type="submit" class="button_more" name="submit" value="<?=GetMessage("MFT_SUBMIT")?>">

$arResult[«PARAMS_HASH»] так понимаю всегда заполнено.
Нужно сделать другое скрытое поле? А потом где делать проверку на заполненность?



0



30 / 26 / 3

Регистрация: 01.09.2018

Сообщений: 141

05.06.2019, 09:27

9

Цитата
Сообщение от _marisha
Посмотреть сообщение

Нужно сделать другое скрытое поле? А потом где делать проверку на заполненность?

на сервере, скрытое поле только боты могут заполнить, поэтому если оно заполнено, значит запрос можно игнорировать.
только поле через стили скрывай, хотя это так себе вариант



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

05.06.2019, 09:27

9

Понравилась статья? Поделить с друзьями:
  • Uncaught in promise error cannot access a chrome url
  • Uncaught exception twig error loader with message
  • Uncaught exception syntax error unexpected token
  • Uncaught exception error the specified module could not be found
  • Uncaught exception error spawn