include/reCaptcha/recaptchalib.php
Constants
Functions
_recaptcha_http_post(
string $host, string $path, array $data, int $port
=
80
)
:
arraySubmits an HTTP POST to a reCAPTCHA server
| Name | Type | Description |
|---|---|---|
| $host | string | |
| $path | string | |
| $data | array | |
| $port | int | port |
| Type | Description |
|---|---|
| array | response |
_recaptcha_mailhide_email_parts(
$email
)
:
voidgets the parts of the email to expose to the user.
eg, given johndoe@example,com return ["john", "example.com"]. the email is then displayed as john...@example.com
| Name | Type | Description |
|---|---|---|
_recaptcha_qsencode(
\$data $data
)
:
stringEncodes the given data into a query string format
| Name | Type | Description |
|---|---|---|
| $data | \$data |
|
| Type | Description |
|---|---|
| string | - encoded request |
recaptcha_check_answer(
string $privkey, string $remoteip, string $challenge, string $response, array $extra_params
=
array()
)
:
\ReCaptchaResponseCalls an HTTP POST function to verify if the user's guess was correct
| Name | Type | Description |
|---|---|---|
| $privkey | string | |
| $remoteip | string | |
| $challenge | string | |
| $response | string | |
| $extra_params | array | an array of extra variables to post to the server |
| Type | Description |
|---|---|
| \ReCaptchaResponse |
recaptcha_get_html(
string $pubkey, string $error
=
null, boolean $use_ssl
=
false
)
:
stringGets the challenge HTML (javascript and non-javascript version).
This is called from the browser, and the resulting reCAPTCHA HTML widget is embedded within the HTML form it was called from.
| Name | Type | Description |
|---|---|---|
| $pubkey | string | A public key for reCAPTCHA |
| $error | string | The error given by reCAPTCHA (optional, default is null) |
| $use_ssl | boolean | Should the request be made over ssl? (optional, default is false) |
| Type | Description |
|---|---|
| string | - The HTML to be embedded in the user's form. |
recaptcha_get_signup_url(
string $domain
=
null, string $appname
=
null
)
:
voidgets a URL where the user can sign up for reCAPTCHA. If your application has a configuration page where you enter a key, you should provide a link using this function.
| Name | Type | Description |
|---|---|---|
| $domain | string | The domain where the page is hosted |
| $appname | string | The name of your application |
recaptcha_mailhide_html(
$pubkey, $privkey, $email
)
:
voidGets html to display an email address given a public an private key.
to get a key, go to:
http://mailhide.recaptcha.net/apikey
| Name | Type | Description |
|---|---|---|
| $pubkey | ||
| $privkey | ||