Created
June 3, 2022 15:44
-
-
Save pingpoli/76a5d9008179993ffc70a4bd2ea479e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( $_SERVER['REQUEST_METHOD'] == "POST" ) | |
{ | |
// check captcha | |
$xPos = $_POST['xPos'] ?? false; | |
$yPos = $_POST['yPos'] ?? false; | |
$sessionXPos = $_SESSION['captcha_x'] ?? false; | |
$sessionYPos = $_SESSION['captcha_y'] ?? false; | |
$xError = abs( $sessionXPos - $xPos ); | |
$yError = abs( $sessionYPos - $yPos ); | |
if ( $xPos !== false && $yPos !== false && $sessionXPos !== false && $sessionYPos !== false && $xError < 0.0001 && $yError < 0.0001 ) | |
{ | |
// process the contact request ... | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment