Article:
 |
|
PHP Form Handling
|
| Subject: |
|
Form submission question |
| Date: |
|
2006-03-06 05:54:16 |
| From: |
|
miles&miles
|
|
|
|
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
|
Showing messages 1 through 1 of 1.
-
Form submission question
2008-08-07 11:18:40
DeputyDawg
[View]
Only some browsers act this way. I believe IE 7.0 is one.
I have experienced this problem with PHP5, but not with PHP4. Cannot explain that one.