test_input($_POST["fname"]); $lname = $this->test_input($_POST["lname"]); $email = $this->test_input($_POST["email"]); $comments = $this->test_input($_POST["comments"]); // compile cleaned message $msg = "From $fname Subject $lname email $email with message $comments"; mail($target,"Website Form Submission",$msg); } public function do_tests(){ $this->fromtest(); $this->ratetest(); $result = $this->traptest(); if($result == 3) { $this->sndmsg("you@yoursite.com"); return 3; }else{ return 0; } } } $lcheck = new antibot(); $winner = $lcheck->do_tests(); if ($winner == 3){ echo "Form Submitted thank you!"; }else{ echo "Error: Send failed, please try again."; } ?>