Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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