PHP Captcha without session

后端 未结 13 1881
傲寒
傲寒 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:21

    Use the honeypot technique: place a text field with a greedy name, as 'email', into an field hidden by CSS (display: none; visibility: hidden;).

    When you have to sanitize the form, simply check if that field is empty, is being send by an human (that cant see the field and so cant fill it up), else, from a spammer.

    That's why usually spammer use to fill up all the fields in the page with predefinited values before sending the form... and doesnt bother the user for reading the captcha.

    Else, rely on the human reading, something like "Write the first $x letter of the word "$word" in the field:"

    Then, you only have to send the $x and $word to the next page and check it (and of course, you can randomize the fields name to be more accurated)

    I remember that a plugin for phpBB forum rely on the fact that, usually, the spam bots selects the first option avaiable (with a value) in the

    提交评论

提交回复
热议问题