From a8445664e8453ac643f123b43823a6a9df83c421 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Mon, 12 Dec 2022 05:58:56 -0800 Subject: Attempt to verify captcha result --- signup.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'signup.php') diff --git a/signup.php b/signup.php index 91ebe69..e52a2e1 100644 --- a/signup.php +++ b/signup.php @@ -25,6 +25,10 @@ if (!empty($_POST['signup'])) { $e = 100; goto err; } + if (!empty($b_config['recaptcha_api_key']) && !recaptcha_verify($_POST['g-recaptcha-response'])) { + $e = 102; + goto err; + } $db = new bdb(); $area = (intval($_POST['phone1'])>0)?intval($_POST['phone1']):intval(substr($_POST['phone1'], 1, -1)); @@ -62,6 +66,7 @@ err: if ($e > 0 && $e < 100) $e_msg = 'The fields indicated are not valid.'; else if ($e == 100) $e_msg = 'The passwords do not match.'; else if ($e == 101) $e_msg = 'A user with your email or phone number already exists.'; +else if ($e == 102) $e_msg = 'Your CAPTCHA solution was not valid.'; else $e_msg = 'An unknown error has occurred.'; ?> @@ -139,14 +144,17 @@ if ($e == 2 || $e == 101) '.PHP_EOL; + else + echo '
'.PHP_EOL; ?> -
-
+
-- cgit v1.2.3