/
requirements.html
62 lines (53 loc) · 2.19 KB
/
requirements.html
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
layout: default
navPage: docs
heading: Before you start / requirements
breadcrumbs:
- Tutorials,/tutorials/
- Adding CAPTCHAs to your POST form,/tutorials/post_form_captchas/
- Before you start / requirements
prev: Introduction,/tutorials/post_form_captchas/
next: Adding a CAPTCHA to your form,/tutorials/post_form_captchas/adding_captcha/
categories: tutorial
versions: FT3
---
{% include open_section.html nav='nav_tutorial_post_form_captchas.html' selected='requirements' nav_width=4 %}
<p>
In order to add a reCAPTCHA to your form, you first need to do the following:
</p>
<ul>
<li>
If you haven't already done so, install the Form Tools API. To get the latest version of the API either do a
standard upgrade by clicking on the "Check for Updates" link in Form Tools, or visit the
<a href="{{site.baseurl}}/api/">API main page</a>.
</li>
<li>
<a href="https://developers.google.com/recaptcha/intro" target="_blank">Visit the reCAPTCHA site here</a>
and sign up for an API key pair.
</li>
<li>
Once you've created an account you register the domain(s) where you're using the service. Since the API only runs on
the same server as your Form Tools installation, you'll only need to set up the one domain. You will need
to choose the <b>reCAPTCHA V2</b> option.
</li>
<li>
Tip: if you're developing locally, you can enter both <b>localhost</b> and <b>127.0.0.1</b> in the Domains
section.
</li>
</ul>
<p>
Once it's set up, reCAPTCHA will generate two keys for you: a <b>site key</b> and a <b>secret key</b>. Add those
two values to your Form Tools <code>global/config.php</code> file, like so:
</p>
{% codemirror php %}
$g_api_recaptcha_site_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$g_api_recaptcha_secret_key = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy";
{% endcodemirror %}
<p>
(replace the x's and y's with your own keys).
</p>
<p>
Your form page need to be a .php file (or whatever file extension is used for PHP on your
server).
</p>
{% include close_section.html %}