Re: anti-spam GD security image code validation
| From: | Scott Gunn | Date: | Wed, 21 Feb 2007 13:21:56 +0000 |
| Subject: | Re: anti-spam GD security image code validation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249178@lists.php.net to get a copy of this message | ||
Could you not ?
1. Generate a code and put it in a session variable
2. Create the validation picture and display to the user
3. On validating compare the code to the session variable
Regards
Scott.
""Bare"" <labunski@latnet.lv> wrote in message
news:58.A3.30289.1964CD54@pb1.pair.com...
> Can someone explain how the validation works?
> I have included a code (that generates random security code and places it
> on a GIF) to the page where the submission form is. Now, when submitting a
> comment, the user has to type and submit this security code.
> So far it's OK, but how to VALIDATE if he has typed the correct code?
> Cause after submitting the form, the code is generated again, but to be
> able to validate submitter's code, I have to check if submitter's code is
> equal to previously generated code, and not to the code that's generated
> after submitting the form.
>
> Ok, I could store actual security code in a hidden text field of the form,
> but then it wold be visible to spam bots, isn't it?
> Or maybe there's another way to do this?
>
>
> Thanks in advance!