CAPTCHA: problem incorporating the script into the webpage.
This fully working script does not work when incorporated into a page. I have tried the following: a) put it into a function (function captcha()) and then called that function; b) created a separate page just for the 'captcha' script, and the included that page with the 'include' function. The result is always the same: The image (.... path ...) cannot be displayed, because it contains errors. This is so frustrating! As I said, the script DOES work on its own. Take a look:
Thanks for your reply!!! Unfortunately, I got the very same error I had getting earlier. BUT, your script gave me an idea that solved the problem.
Instead of doing this:
<img src="<?php include(.....); ?>" />
I did it with no PHP tags:
<img src="captcha.php" />
CAPTCHA works now. A minor problem is, though, for some reason I can't set the SESSION key initially, when the page first loads. Of course, after I refresh the page, the SESSION key is there, but not the first time around.