|
Hi,
I am just a little bit confused about the submit check that the author talks about at the beginning of the article.
He says using the following code on the form:
<input type="hidden" name="_submit_check" value="1"/>
and then checking its presence with the following code:
if (array_key_exists('_submit_check', $_POST)) {
/* ... do something with the form parameters ... */
}
will avoid problems when users press enter instead of the submit button.
What I don't understand is what stops the hidden field being sent when enter is pressed. Basically I dont understand how using this code differentiates between a enter key or a submit button being pressed.
Can anyone clear this up for me?
Thanks
|