From 0085e272b2002437f11f74ccdde0d6975f2cd9f2 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Tue, 17 Aug 2010 13:40:52 -0400 Subject: Added back reCAPTCHA Because of the lifting of the jail around my server, it can once again use reCAPTCHAs for security. Backed out changeset 9332c237adcd --- pages/post.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pages/post.php') diff --git a/pages/post.php b/pages/post.php index fd826a5..121435a 100755 --- a/pages/post.php +++ b/pages/post.php @@ -21,7 +21,9 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} require('headerproc.php'); -require('includes/securimage/securimage.php'); + +include('includes/recaptchalib.php'); +$privatekey = "6LfgvgEAAAAAAD0_UVLp57MU7tqcypsbZPS9qTnr"; if (!isset($_POST['id'])) { @@ -39,11 +41,10 @@ if (!isset($_POST['id'])) } else { if (preg_match('/^[A-Za-z0-9!#$&\'*+-\/=?^_`{|}~]+@[-A-Za-z0-9]+(\.[-A-Za-z0-9]+)+[A-Za-z]$/', $_POST['email'])) { - $img = new Securimage; - - if ($img->check($_POST['code']) == false) + $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); + if (!$resp->is_valid) { - die('The CAPTCHA wasn\'t entered correctly. Go back and try it again.'); + die('The reCAPTCHA wasn\'t entered correctly. Go back and try it again.'); } else { $getanon = "SELECT * FROM anon_commenters WHERE username = \"" . $_POST['username'] . "\""; $getanon2 = mysql_query($getanon); -- cgit 1.4.1