FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Eregi possible problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Eregi possible problem [message #169364 is a reply to message #169362] Wed, 08 September 2010 16:13 Go to previous messageGo to previous message
gordonb.s1b9p is currently offline  gordonb.s1b9p
Messages: 1
Registered: September 2010
Karma:
Junior Member
>> That's PHP telling you that your code is sloppy.  Unchecked checkboxes
>> don't get passed with POST/GET operations, so you are in effect doing
>> the same as the following:

A lot of my code for dealing with input involves checking whether
the variable is not set, or it wasn't filled in, and either ignoring
that field or returning an error that filling it in is required.
isset() gets used a lot.

> I "solved" this today in a different way....
> First I set all values to nej.
> <input name="boksin" type="hidden" value="nej">
> <input name="boksil" type="hidden" value="nej">
> <input name="boktav" type="hidden" value="nej">
> <input name="boklic" type="hidden" value="nej">
> <input name="bokncg" type="hidden" value="nej">
> <input name="bokpap" type="hidden" value="nej">
>
> Then if they are later displayed as checkboxes the value is
> redeclared, if not then the "post" reads from the above. Your answer
> was obviously more professional and correct but isn't the main thing
> to get things working?

Are you sure that is guaranteed to work on all browsers? Including
IE12, when it comes out? You might get it to work on most of them
but a few strange ones will use the first value only. Check the
HTML spec to see if what you are doing is safe.


> :) Perhaps, but sometimes I have taken sledgehammers to crack nuts.

Just be sure the sledgehammer doesn't miss and crack something
you didn't want to crack along with the nuts.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Another heredoc question
Next Topic: php filling in listbox value based on db record ??
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 14:24:04 GMT 2024

Total time taken to generate the page: 0.03988 seconds