fromtest(); $this->ratetest(); $result = $this->traptest(); if($result == 3) { $this->sndmsg("webmaster@pngpst.net"); return 3; }else{ return 0; } } } $antibot = new antibot(); if ($_SERVER["REQUEST_METHOD"] == "POST") { // Check if the CSRF token is present if (isset($_POST['csrf_token'])) { $user_token = $_POST['csrf_token']; // Check if the submitted token matches the stored session token if ($user_token === $_SESSION['csrf_token']) { // Token is valid, process the form // ... Your form processing logic goes here ... $winner = $antibot->do_tests(); if ($winner == 3){ echo "Form Submitted thank you!"; }else{ echo "Error: Send failed, please try again. -1"; } } else { // Invalid token, handle accordingly (e.g., log the incident, reject the form) die("Error: Send failed, please try again. -2"); } } else { // CSRF token is not present, handle accordingly die("Error: Send failed, please try again. -3"); } } //else { // Handle non-POST requests accordingly //die("Invalid request method."); //} // $winner = $lcheck->do_tests(); //if ($winner == 3){ // echo "Form Submitted thank you!"; // }else{ // echo "Error: Send failed, please try again."; //} ?>