mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-26 06:43:47 +01:00
MI update
This commit is contained in:
@@ -77,4 +77,19 @@ function groupByCategory(&$supported){
|
||||
array_push($grouped[$val[1]][0],[$key,$val[0]]);
|
||||
}
|
||||
return $grouped;
|
||||
}
|
||||
|
||||
function checkCaptcha($response){
|
||||
$url = "https://www.google.com/recaptcha/api/siteverify";
|
||||
$post = 'secret='.'6Lc7gXAUAAAAAOTbo2u3IXoSB6KlhtVmUHTzpcGY&response='. $response;
|
||||
|
||||
$ch = curl_init( $url );
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $post);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
||||
$response = curl_exec( $ch );
|
||||
return json_decode($response)["success"];
|
||||
}
|
||||
Reference in New Issue
Block a user