Procedural File: recaptchalib.php
Source Location: /users/classes/recaptchalib.php
Classes:
ReCaptchaResponse
A ReCaptchaResponse is returned from recaptcha_check_answer()
Page Details:
This is a PHP library that handles calling reCAPTCHA.
- Documentation and latest version
http://recaptcha.net/plugins/php/
- Get a reCAPTCHA API Key
https://www.google.com/recaptcha/admin/create
- Discussion group
http://groups.google.com/group/recaptcha
Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net AUTHORS: Mike Crawford Ben MaurerPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Tags:
RECAPTCHA_API_SECURE_SERVER [line 42]
RECAPTCHA_API_SERVER [line 41]
RECAPTCHA_VERIFY_SERVER [line 43]
recaptcha_check_answer [line 157]
ReCaptchaResponse recaptcha_check_answer(
string $privkey, string $remoteip, string $challenge, string $response, [array $extra_params = array()])
|
|
Calls an HTTP POST function to verify if the user's guess was correct
Parameters
string |
$privkey |
|
string |
$remoteip |
|
string |
$challenge |
|
string |
$response |
|
array |
$extra_params |
an array of extra variables to post to the server |
recaptcha_get_html [line 109]
string recaptcha_get_html(
string $pubkey, [string $error = null], [boolean $use_ssl = false])
|
|
Gets 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.
Tags:
Parameters
string |
$pubkey |
A public key for reCAPTCHA |
string |
$error |
The error given by reCAPTCHA (optional, default is null) |
boolean |
$use_ssl |
Should the request be made over ssl? (optional, default is false) |
recaptcha_get_signup_url [line 207]
void recaptcha_get_signup_url(
[string $domain = null], [string $appname = null])
|
|
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.
Parameters
string |
$domain |
The domain where the page is hosted |
string |
$appname |
The name of your application |
recaptcha_mailhide_html [line 272]
void recaptcha_mailhide_html(
$pubkey, $privkey, $email)
|
|
Gets html to display an email address given a public an private key. to get a key, go to: http://www.google.com/recaptcha/mailhide/apikey
Parameters
recaptcha_mailhide_url [line 235]
void recaptcha_mailhide_url(
$pubkey, $privkey, $email)
|
|
Parameters
_recaptcha_aes_encrypt [line 219]
void _recaptcha_aes_encrypt(
$val, $ky)
|
|
Parameters
_recaptcha_aes_pad [line 211]
void _recaptcha_aes_pad(
$val)
|
|
Parameters
_recaptcha_http_post [line 70]
array _recaptcha_http_post(
string $host, string $path, array $data, [int $port = 80])
|
|
Submits an HTTP POST to a reCAPTCHA server
Tags:
Parameters
string |
$host |
|
string |
$path |
|
array |
$data |
|
int |
$port |
port |
_recaptcha_mailhide_email_parts [line 253]
void _recaptcha_mailhide_email_parts(
$email)
|
|
gets 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
Parameters
_recaptcha_mailhide_urlbase64 [line 230]
void _recaptcha_mailhide_urlbase64(
$x)
|
|
Parameters
_recaptcha_qsencode [line 50]
string _recaptcha_qsencode(
$data $data)
|
|
Encodes the given data into a query string format
Tags:
Parameters
$data |
$data |
- array of string elements to be encoded |
|