You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by James Ponder <ja...@db.com> on 2002/07/09 16:43:01 UTC

%fdat and 0-length values

Hi,

I think I have found a bug, or at least an undocumented feature.  If the query string contains a field with a 0-length value (i.e. the empty string) Embperl does not pass this into %fdat, instead, it leaves it not existing in the hash (effectively undefined).

For example:  ?entry=&foo=bar and ?foo=bar both result in $fdat{entry} not existing, when what should happen is that $fdat{entry} is "" in the first case.

This makes it impossible to distinguish between the user entering an empty value and the field not being present.  This is often seen when you have a page that can be used to add an entry and modify an entry where the identifier being present is used to determine if you should be adding or modifying, for example:

modify existing item "foo":
      item.html?entry=foo

add new item:
      item.html

All ok, until you have the situation where you can have the empty string identifier:

modify existing item "":
      item.html?entry=


Best wishes, James
--
James Ponder



--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: %fdat and 0-length values

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> I think I have found a bug, or at least an undocumented feature.

It's neither a bug nor undocumented. Just set optAllFormFields in
EMBPERL_OPTIONS in your httpd.conf and you get all fields.

BTW. optAllFormFields will be on by default for the next 2.0 beta

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org