Here are necessary and sufficient guidelines how to handle validation process manually. I have used it on many occasions. You do not need to use captcha exactly in your form -- you can do it wherever you want on the page that is being validated.
1) include onto your page captcha image (no matter inside or outside your form):
<img src="/manager/includes/veriword.php" ....... />
--> veriword.php script does two things: it generates random image + it stores image’s content in textual format into the variable $_SESSION[’veriword’]
2) include into your form a textfield where user should enter verification code
3) within your script that handles submitted data compare user-provided code with the $_SESSION[’veriword’] variable -- if both values match, user successfully proved his "human nature"