Re: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-27 Thread Burhan Khalid
Michael Sims wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: If one must check the value and not just the existence of the checkbox entry, or for other uses, e.g. where a flag may or may not be present, one is saddled with clumsy constructs like: if (($isset($array['index'])

Re: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-27 Thread Jochem Maas
Michael Sims wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: If one must check the value and not just the existence of the checkbox entry, or for other uses, e.g. where a flag may or may not be present, one is saddled with clumsy constructs like: if (($isset($array['index'])

RE: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-27 Thread Michael Sims
Burhan Khalid wrote: Michael Sims wrote: [EMAIL PROTECTED] wrote: If one must check the value and not just the existence of the checkbox entry, or for other uses, e.g. where a flag may or may not be present, one is saddled with clumsy constructs like: if (($isset($array['index'])

RE: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-27 Thread Michael Sims
Jochem Maas wrote: Michael Sims wrote: On a controller page (the C in MVC) that handles form submissions I create an array which defines what form variables are available and their default values if not entered. I then use array_merge() to combine that array with $_POST (or $_GET, as the

RE: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-27 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 26 January 2005 19:56, [EMAIL PROTECTED] wrote: On 26 Jan 2005 Jason Barnett wrote: if (isset($_POST['checkboxfieldname'])) { /** do stuff */ } Sorry, I should

Re: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-26 Thread trlists
On 26 Jan 2005 Jason Barnett wrote: if (isset($_POST['checkboxfieldname'])) { /** do stuff */ } Sorry, I should have mentioned that I knew about using isset -- it works OK for the checkbox example, though I'm not clear if this behavior is specified and therefore will not change -- i.e.

Re: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-26 Thread DvDmanDT
I'm pretty sure you can rely on the fact that they are undefined if not checked.. It's somewhere in the HTML or HTTP standard.. Also, the manual page of empty() says it won't generate errors if the variable isn't set.. So empty() is probably the best way to go then.. -- // DvDmanDT MSN:

Re: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-26 Thread Jochem Maas
[EMAIL PROTECTED] wrote: On 26 Jan 2005 Jason Barnett wrote: if (isset($_POST['checkboxfieldname'])) { /** do stuff */ } Sorry, I should have mentioned that I knew about using isset -- it works OK for the checkbox example, though I'm not clear if this behavior is specified and therefore will

RE: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-26 Thread Michael Sims
Jochem Maas wrote: [EMAIL PROTECTED] wrote: If one must check the value and not just the existence of the checkbox entry, or for other uses, e.g. where a flag may or may not be present, one is saddled with clumsy constructs like: if (($isset($array['index']) ($array['index'] == 1)) ...