I'm writing a site in PHP. And I have a simple registration form.
<form>
<label...></label> <input .../>
</form>
I want to add a confirmation field:
<input type='hidden' name='hiddeninput' value="jn3kjnv3kjvn35">
But how does this code look on the server side? Do I need to save every hidden value to the database whenever registration form is loaded?
I'm trying to make sure the form is not being filled in by bots.
That's why I need a random hidden value that is unique for every form submission.
Suppose every time I generate the registration page - I generate the unique value for "hidden" field.
When the user submits the form - how do I compare the submitted value to the one that was generated (as once it's generated - it's not stored anywhere in the site).