Documentation

recaptchalib.php

The reCAPTCHA server URL's

Table of Contents

Classes

ReCaptchaResponse
A ReCaptchaResponse is returned from recaptcha_check_answer()

Constants

RECAPTCHA_API_SECURE_SERVER  = "https://www.google.com/recaptcha/api.js"
RECAPTCHA_API_SERVER  = "http://www.google.com/recaptcha/api.js"
The reCAPTCHA server URL's
RECAPTCHA_VERIFY_SERVER  = "https://www.google.com"

Functions

_recaptcha_qsencode()  : string
Encodes the given data into a query string format
_recaptcha_http_post()  : string
Submits an HTTP POST to a reCAPTCHA server
recaptcha_get_html()  : string
Gets the challenge HTML (javascript and non-javascript version).
recaptcha_check_answer()  : ReCaptchaResponse
Calls an HTTP POST function to verify if the user's guess was correct
recaptcha_get_signup_url()  : mixed
gets 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.
_recaptcha_aes_pad()  : mixed
_recaptcha_aes_encrypt()  : mixed
Mailhide related code
_recaptcha_mailhide_urlbase64()  : mixed
recaptcha_mailhide_url()  : mixed
gets the reCAPTCHA Mailhide url for a given email, public key and private key
_recaptcha_mailhide_email_parts()  : mixed
gets the parts of the email to expose to the user.
recaptcha_mailhide_html()  : mixed
Gets html to display an email address given a public an private key.

Constants

RECAPTCHA_API_SECURE_SERVER

public mixed RECAPTCHA_API_SECURE_SERVER = "https://www.google.com/recaptcha/api.js"

RECAPTCHA_API_SERVER

The reCAPTCHA server URL's

public mixed RECAPTCHA_API_SERVER = "http://www.google.com/recaptcha/api.js"

RECAPTCHA_VERIFY_SERVER

public mixed RECAPTCHA_VERIFY_SERVER = "https://www.google.com"

Functions

_recaptcha_qsencode()

Encodes the given data into a query string format

_recaptcha_qsencode(mixed $data) : string
Parameters
$data : mixed
  • array of string elements to be encoded
Return values
string
  • encoded request

_recaptcha_http_post()

Submits an HTTP POST to a reCAPTCHA server

_recaptcha_http_post(string $host, string $path, array<string|int, mixed> $data) : string
Parameters
$host : string
$path : string
$data : array<string|int, mixed>
Return values
string

response

recaptcha_get_html()

Gets the challenge HTML (javascript and non-javascript version).

recaptcha_get_html(string $pubkey[, string $error = NULL ][, bool $use_ssl = FALSE ]) : string

This is called from the browser, and the resulting reCAPTCHA HTML widget is embedded within the HTML form it was called from.

Parameters
$pubkey : string

A public key for reCAPTCHA

$error : string = NULL

The error given by reCAPTCHA (optional, default is null)

$use_ssl : bool = FALSE

Should the request be made over ssl? (optional, default is false)

Return values
string
  • The HTML to be embedded in the user's form.

recaptcha_check_answer()

Calls an HTTP POST function to verify if the user's guess was correct

recaptcha_check_answer(string $privkey, string $remoteip, string $response[, array<string|int, mixed> $extra_params = array() ]) : ReCaptchaResponse
Parameters
$privkey : string
$remoteip : string
$response : string
$extra_params : array<string|int, mixed> = array()

an array of extra variables to post to the server

Return values
ReCaptchaResponse

recaptcha_get_signup_url()

gets 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.

recaptcha_get_signup_url([string $domain = NULL ][, string $appname = NULL ]) : mixed
Parameters
$domain : string = NULL

The domain where the page is hosted

$appname : string = NULL

The name of your application

_recaptcha_aes_pad()

_recaptcha_aes_pad(mixed $val) : mixed
Parameters
$val : mixed

_recaptcha_aes_encrypt()

Mailhide related code

_recaptcha_aes_encrypt(mixed $val, mixed $ky) : mixed
Parameters
$val : mixed
$ky : mixed

_recaptcha_mailhide_urlbase64()

_recaptcha_mailhide_urlbase64(mixed $x) : mixed
Parameters
$x : mixed

recaptcha_mailhide_url()

gets the reCAPTCHA Mailhide url for a given email, public key and private key

recaptcha_mailhide_url(mixed $pubkey, mixed $privkey, mixed $email) : mixed
Parameters
$pubkey : mixed
$privkey : mixed
$email : mixed

_recaptcha_mailhide_email_parts()

gets the parts of the email to expose to the user.

_recaptcha_mailhide_email_parts(mixed $email) : mixed

eg, given johndoe@example,com return ["john", "example.com"]. the email is then displayed as john...@example.com

Parameters
$email : mixed

recaptcha_mailhide_html()

Gets html to display an email address given a public an private key.

recaptcha_mailhide_html(mixed $pubkey, mixed $privkey, mixed $email) : mixed

to get a key, go to:

http://www.google.com/recaptcha/mailhide/apikey

Parameters
$pubkey : mixed
$privkey : mixed
$email : mixed

        
On this page

Search results