-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
27 lines (22 loc) · 1 KB
/
process.php
File metadata and controls
27 lines (22 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// Your secret key obtained from Cloudflare
$secretKey = '0x4AAAAAAANTaBDg0GijvKIA5n7tdqpQxCY';
// User response from the form
$userResponse = $_POST['g-recaptcha-response'];
// Verify the user's response
$response = file_get_contents("https://www.cloudflare.com/recaptcha/api/siteverify?secret={$secretKey}&response={$userResponse}");
$responseKeys = json_decode($response, true);
// Check if the reCAPTCHA was successful
if (intval($responseKeys["success"]) !== 1) {
// The reCAPTCHA was not successful, handle accordingly (e.g., show an error)
echo "reCAPTCHA verification failed";
} else {
// The reCAPTCHA was successful, proceed with form processing
// Example: Access form data
$username = $_POST['username'];
$password = $_POST['password'];
// Example: Perform further actions like database operations, authentication, etc.
// Process your form data here
echo "Form submitted successfully. Username: {$username}, Password: {$password}";
}
?>