Hello, I want to protect a few pages on my site using captcha. Once the user identifies himself using a captcha, he need not do it again for the other pages, until he clears cookies. Is it possible to do it? Almost all captcha examples are for web forms.
Sure! You will have captcha on all forms with an if before it. Check if a cookie exists or not. If so, then do not show captcha and do not check for its value on the result page. What is confusing you? Or do you wonder if it is possible?
you need to create session when user identify him self, then if(isset($_SESSION["user"])) { //don't show captcha } else { //show captcha } PHP:
I tried using cookies, but I'm getting this error Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxx/public_html/verify.php:8) in /home/xxxxxx/public_html/verify.php on line 28 Code (markup):
Line 28 is setcookie("real", "Real User", time()+36000); Line 8 is echo(<head><body><form action=\"\" method=\"post\">);
Good fix, although you should try to always send all your headers before sending anything else (e.g. xhtml). Another (more ugly) fix would have been to set the Cookie via JavaScript.
Here is my captcha, not the best, but easy to install. I have put some examples there. http://dy.xrvel.googlepages.com/animatedcaptcha.zip