{"id":5,"date":"2024-04-12T00:14:36","date_gmt":"2024-04-12T00:14:36","guid":{"rendered":"https:\/\/faq.cinar-studio.ru\/?p=5"},"modified":"2024-04-27T23:28:45","modified_gmt":"2024-04-27T23:28:45","slug":"google-recaptcha-v2-na-primere-mfc-ritual-ru","status":"publish","type":"post","link":"https:\/\/faq.cinar-studio.ru\/?p=5","title":{"rendered":"google recaptcha v2 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 mfc-ritual.ru (\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f Bitrix)"},"content":{"rendered":"<blockquote><p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043a\u0440\u0440\u0438\u043f\u0442\u0430 \u043f\u043b\u0430\u0442\u043d\u0430\u044f.<\/p>\n<p>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435, \u0435\u0441\u043b\u0438 \u043a\u0430\u043f\u0447\u0430 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430! \u0411\u0415\u0417 \u0423\u0412\u0415\u0414\u041e\u041c\u041b\u0415\u041d\u0418\u0419!<\/p><\/blockquote>\n<p>\u0438\u0434\u0435\u043c \u043f\u043e \u043f\u0443\u0442\u044f\u043c \u043a \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \/local\/templates\/.default\/components\/bitrix\/form.result.new\/default.form<\/p>\n<p>\u0444\u0430\u0439\u043b template.php<\/p>\n<p>\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c<\/p>\n<p>&lt;div class=&#8221;google-box&#8221;&gt;<br \/>\n&lt;div class=&#8221;g-recaptcha&#8221; data-sitekey=&#8221;\u0412\u0410\u0428 \u041a\u041b\u042e\u0427 \u0421\u0410\u0419\u0422\u0410&gt;&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>\u0432 \/local\/php_interface<\/p>\n<p>\u0432 \u0444\u0430\u0439\u043b init.php \u043d\u0430\u0432\u0435\u0440\u0445<\/p>\n<p>\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c<\/p>\n<p>if(!empty($_POST)) {<br \/>\nif(!isset($_POST[&#8216;g-recaptcha-response&#8217;]) || empty($_POST[&#8216;g-recaptcha-response&#8217;])) {<br \/>\necho &#8216;\u041e\u0448\u0438\u0431\u043a\u0430, \u043a\u0430\u043f\u0447\u0430 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430&#8217;;<br \/>\nexit;<br \/>\n} else {<br \/>\n$secret = &#8216;\u0421\u0415\u041a\u0420\u0415\u0422\u041d\u042b\u0419 \u041a\u041b\u042e\u0427&#8217;;<br \/>\n$ch = curl_init();<br \/>\ncurl_setopt($ch, CURLOPT_URL, &#8216;https:\/\/www.google.com\/recaptcha\/api\/siteverify?secret=&#8217;.$secret.&#8217;&amp;response=&#8217;.$_POST[&#8216;g-recaptcha-response&#8217;]);<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br \/>\n$response = curl_exec($ch);<br \/>\ncurl_close($ch);<br \/>\n$response = json_decode($response);<br \/>\nif($response-&gt;success) {<br \/>\necho &#8216;Successful login.&#8217;;<br \/>\n} else {<br \/>\necho &#8216;reCAPTHCA verification failed, please try again.&#8217;;<br \/>\nexit;<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>\u0441\u043a\u0440\u0438\u043f\u0442<\/p>\n<p>&lt;script src=&#8217;https:\/\/www.google.com\/recaptcha\/api.js&#8217; async defer &gt;&lt;\/script&gt;<\/p>\n<p>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u00a0 \u0432\u00a0 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u0444\u043e\u0440\u043c\u044b, \u0435\u0441\u043b\u0438 \u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 ajax<\/p>\n<p>\u043d\u043e\u00a0 \u0442\u0430\u043a\u0436\u0435 \u0438\u00a0 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u0448\u0430\u043f\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u0442\u044d\u0433\u043e\u043c head<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043a\u0440\u0440\u0438\u043f\u0442\u0430 \u043f\u043b\u0430\u0442\u043d\u0430\u044f. \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435, \u0435\u0441\u043b\u0438 \u043a\u0430\u043f\u0447\u0430 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430! \u0411\u0415\u0417 \u0423\u0412\u0415\u0414\u041e\u041c\u041b\u0415\u041d\u0418\u0419! \u0438\u0434\u0435\u043c \u043f\u043e \u043f\u0443\u0442\u044f\u043c \u043a \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \/local\/templates\/.default\/components\/bitrix\/form.result.new\/default.form \u0444\u0430\u0439\u043b template.php \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c &lt;div class=&#8221;google-box&#8221;&gt; &lt;div class=&#8221;g-recaptcha&#8221; data-sitekey=&#8221;\u0412\u0410\u0428 \u041a\u041b\u042e\u0427 \u0421\u0410\u0419\u0422\u0410&gt;&lt;\/div&gt; &lt;\/div&gt; \u0432 \/local\/php_interface \u0432 \u0444\u0430\u0439\u043b init.php \u043d\u0430\u0432\u0435\u0440\u0445 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c if(!empty($_POST)) { if(!isset($_POST[&#8216;g-recaptcha-response&#8217;]) || empty($_POST[&#8216;g-recaptcha-response&#8217;])) { echo &#8216;\u041e\u0448\u0438\u0431\u043a\u0430, \u043a\u0430\u043f\u0447\u0430 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430&#8217;; exit; } else [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=\/wp\/v2\/posts\/5"}],"collection":[{"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5"}],"version-history":[{"count":8,"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":41,"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=\/wp\/v2\/posts\/5\/revisions\/41"}],"wp:attachment":[{"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/faq.cinar-studio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}