PHP Captcha without session

后端 未结 13 1653
傲寒
傲寒 2021-01-04 13:51

Ok, here is an issue: in the project i\'m working on, we can\'t rely on server-side sessions for any functionality.

The problem is that common captcha solutions fro

13条回答
  •  囚心锁ツ
    2021-01-04 14:37

    My own idea, don't know is it good:

    1) If user is logged, just use some hash function on his login and generate CAPTCHA with it,

    2)if it is register form, etc just hash some value from form field (for example login, when user finished type it) and by ajax show CAPTCHA with hash from login.

    Hope, that it is understandable. :)

    EDIT: Without AJAX: 2 steps registration:

    At 1, we collect login etc. after submit, we direct to ?login=new_login

    At 2, we have hidden input with GET["login"] and hash from it in CAPTCHA image - after submit we have all to check answer.

提交回复
热议问题