This is a discussion on HTML form truncation: stops parsing on empty string within the PHP General forums, part of the PHP Programming Forums category; Hi, everyone, PHP seems to hang up when it finds an HTML text input with a value of either '0' ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi, everyone,
PHP seems to hang up when it finds an HTML text input with a value of either '0' or ''. Anything that would return "true" when tested with empty() seems to prevent all of the following inputs from being parsed into the $_REQUEST string, even PHPSESSID and some hidden inputs that are hard-coded into the form. Basically, I'm losing data unless dummy values are filled in. What gives? I would like to give users the option of leaving an input blank one time, and a different input blank the next, so re-ordering the form to handle truncation due to empty strings really isn't an option. Default values for the inputs are already being set by querying the database of existing fields, so it would be trivial to append ' ' to each. Unfortunately there would still be the possibility of error if a user deleted the space, and in any event this would be a hack rather than a real, elegant solution. Any advice? |
|
|||
|
It seems this problem has cleared up on its own.
Given what I changed when it improved, it may have been due to the way I was querying MySQL to generate the input names, although I can't see how adding single quotes around a variable name was would change the form parsing behavior. Particularly mysterious is that the HTML source for the form doesn't seem to have changed, only the response afterward. This seems magical, since the HTML source is theoretically the only channel for information between the form generating script and the form parsing script. Odd, odd, odd. |