Files
ms1inscription-v5/jira.php
2026-05-13 09:43:32 -04:00

28 lines
936 B
PHP

<?php
session_start();
require_once('php/inc_fonctions.php');
require_once('php/inc_fx_messages.php');
$lang = stripslashes($_POST["lang"]);
$sender_name = stripslashes($_POST["txt_nom"]);
$sender_email = stripslashes($_POST["txt_courriel"]);
$sender_message = stripslashes($_POST["txt_message"]);
$response = $_POST["g-recaptcha-response"];
$url = 'https://www.google.com/recaptcha/api/siteverify';
$data = array(
'secret' => '6Le4I10UAAAAAL2_8MGw7K63F2Supf_gnUxiENyr',
'response' => $_POST["g-recaptcha-response"]
);
$options = array(
'http' => array (
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$verify = file_get_contents($url, false, $context);
$captcha_success=json_decode($verify);
if ($captcha_success->success==false) {
echo "<p>You are a bot! Go away!</p>";
} else if ($captcha_success->success==true) {
print_r( $_POST);
}