开发者

Implementing captcha only once for one session

开发者 https://www.devze.com 2023-03-21 23:35 出处:网络
I\'ve been working on a website which contains alot of links. I want to protect those links from bots/crawlers by implementing a CAPTCHA. I\'ve tried reCAPTCHA by Google but it doesn\'t suit my needs(

I've been working on a website which contains alot of links. I want to protect those links from bots/crawlers by implementing a CAPTCHA. I've tried reCAPTCHA by Google but it doesn't suit my needs(complex specially when it comes to people who are poor in English :P) plus I just want to stop the new programmers or crawlers, I know it can easily be broken by experienced programmers. So I searched and found this one to be good.

http://www.hardcode.nl/subcategory_4/article_243-simple-php-captcha-script.htm

Downloaded it and its working like a charm but my problem is :

1. I can see the index.html files checks the entered code and if correct redirects to write开发者_JAVA技巧.php where session is created and output is shown. I want this to be done on the same page. Like when user enters correct code, he should be able to view the view the links on the same page to save bandwidth (I'll fetch them from mysql server)

2. This is more important one, since I don't know anything about php sessions and php.net tutorials are just too short or next to nothing, can this be done that whenever a user input correct captcha once, he can see the links for rest of the time without captcha? And he will have to re-enter the captcha only when he closes the browser or after some interval like 10 minutes in case previous one can't be done. Thank you

PS. I can use Javascript on my server but probably a php solution will be better since I'm also learning php


  1. Use AJAX to pull the links and then replace the HTML in the page.

  2. Store a variable in the session that determines whether or not they've entered a CAPTCHA, then just check that before deciding whether to show the CAPTCHA or the links.

0

精彩评论

暂无评论...
验证码 换一张
取 消