testing changes to contact form
This commit is contained in:
parent
1de4969e82
commit
da306f598b
20
contact.php
20
contact.php
@ -10,14 +10,10 @@ include_once $URlcorrection . "includes/header.php";
|
|||||||
include_once $URlcorrection . "includes/banner.php";
|
include_once $URlcorrection . "includes/banner.php";
|
||||||
include_once $URlcorrection . "includes/nav.php";
|
include_once $URlcorrection . "includes/nav.php";
|
||||||
|
|
||||||
// Generate a new CAPTCHA question if not set
|
// Generate CAPTCHA numbers
|
||||||
if (!isset($_SESSION['captcha'])) {
|
$num1 = rand(1, 10);
|
||||||
$_SESSION['captcha'] = [
|
$num2 = rand(1, 10);
|
||||||
'num1' => rand(1, 10),
|
$captchaAnswer = $num1 + $num2;
|
||||||
'num2' => rand(1, 10),
|
|
||||||
'answer' => $_SESSION['captcha']['num1'] + $_SESSION['captcha']['num2']
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
$name = trim($_POST['name']);
|
$name = trim($_POST['name']);
|
||||||
@ -52,13 +48,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a new CAPTCHA for the next submission AFTER processing the form
|
|
||||||
$_SESSION['captcha'] = [
|
|
||||||
'num1' => rand(1, 10),
|
|
||||||
'num2' => rand(1, 10),
|
|
||||||
'answer' => $_SESSION['captcha']['num1'] + $_SESSION['captcha']['num2']
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user