That appears to work, although I'm sure I tried it this way also except with the != (not equal to) instead of the == (equal to) operator. Doesn't matter as long as it works.
You are correct, I'm trying to create some level of form protection using a random image rotator that displays images with a sequence of numbers and letters. This should prevent some lower level spam bots from accessing my forms.
Originally, I wanted an "in-between" page with just the validation script above on it. If the validation was successful the form information would be sent on to the formmail page for processing, if not they were instructed to go back and correct the mistake. However, I couldn't figure out how to get the form results to pass on to the formmail page. On the "in-between" page I would have
$your_name = $_POST["your_name"];
$your_address = $_POST["your_address"];
but I couldn't figure out how to pass this along to the formmail because it had already been posted.
I have looked at some CAPTCHA tutorials, but found them to be rather complicated and confusing. They mainly showed how to create the CAPTCHA, but not how to integrate it into use with a form. I haven't looked at all of them of course, but I wanted something that I could use immediately and came up with the above idea.
Another thing, the displays of most of the CAPTCHAs I saw were not easy to read. I had trouble determining some of the letters so I know a little old lady would have difficulty. It would be helpful for instance if CAPTCHAs that use both numbers and letters put a line through the zero's since they can be easily mistaken for the letter O.
Thanks for your help!
David
*** Update
I pieced together a CAPTCHA system and have it working.