Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body> <!-- the body tag is required or the CAPTCHA may not show on some browsers -->
- your HTML content
- <?php
- $publickey = "XXX";
- $privatekey = "YYY";
- require_once('recaptchalib.php');
- if (isset($_POST["recaptcha_response_field"])){
- echo "<pre>";
- print_r($_POST);
- require_once('recaptchalib.php');
- $resp = recaptcha_check_answer ($privatekey,
- $_SERVER["REMOTE_ADDR"],
- $_POST["recaptcha_challenge_field"],
- $_POST["recaptcha_response_field"]);
- print_r($resp);
- print_r($_SERVER);
- }
- ?>
- <form method="post" action="recaptcha.php">
- <?php echo recaptcha_get_html($publickey); ?>
- <input type="submit" />
- </form>
- more of your HTML content
- </body>
- </html>
- <!-- Example output for valid entry
- Array
- (
- [recaptcha_challenge_field] => 03AHJ_VuvHgC572BKLlgNYGK3_6XxQHRI4gakBrWRC9wgenmWDDMWJngNMt-33gV0N9g0AD6qMPnYst38yQ_X2WQkz13ffHLrrU7fmjmvuH42M00T6VH3lZ4QM5VoZb7k5zQChr_vgeuUo9GerHwASwP2mp5hE8ZBI7Q
- [recaptcha_response_field] => iitingn 26
- )
- ReCaptchaResponse Object
- (
- [is_valid] => 1
- [error] =>
- )
- Array
- (
- [UNIQUE_ID] => T5lcRn8AAAEAABCSU-QAAAAH
- [HTTP_HOST] => localhost
- [HTTP_USER_AGENT] => Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0
- [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- [HTTP_ACCEPT_LANGUAGE] => en-gb,en-us;q=0.8,en;q=0.5,fr;q=0.3
- [HTTP_ACCEPT_ENCODING] => gzip, deflate
- [HTTP_DNT] => 1
- [HTTP_CONNECTION] => keep-alive
- [HTTP_REFERER] => http://localhost/recaptcha.php
- [CONTENT_TYPE] => application/x-www-form-urlencoded
- [CONTENT_LENGTH] => 226
- [PATH] => /sbin:/usr/sbin:/bin:/usr/bin
- [SERVER_SIGNATURE] =>
- Apache/2.2.17 (PCLinuxOS 2011/PREFORK-1pclos2011) Server at localhost Port 80
- [SERVER_SOFTWARE] => Apache/2.2.17 (PCLinuxOS 2011/PREFORK-1pclos2011)
- [SERVER_NAME] => localhost
- [SERVER_ADDR] => 127.0.0.1
- [SERVER_PORT] => 80
- [REMOTE_ADDR] => 127.0.0.1
- [DOCUMENT_ROOT] => /var/www/html
- [SERVER_ADMIN] => root@localhost
- [SCRIPT_FILENAME] => /var/www/html/recaptcha.php
- [REMOTE_PORT] => 50032
- [GATEWAY_INTERFACE] => CGI/1.1
- [SERVER_PROTOCOL] => HTTP/1.1
- [REQUEST_METHOD] => POST
- [QUERY_STRING] =>
- [REQUEST_URI] => /recaptcha.php
- [SCRIPT_NAME] => /recaptcha.php
- [PHP_SELF] => /recaptcha.php
- [REQUEST_TIME] => 1335450694
- )
- -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement