Re: [PHP] Checking for empty()

2006-06-14 Thread Richard Lynch
If you just want to disallow strings of only whitespace, http://php.net/trim them first. The ideal sanitization, however, lists all the characters you DO want to allow, rather than attempting (and probably failing) to try to consider all the ways a user might (intentionally or not) screw up. $CLE

Re: [PHP] Checking for empty()

2006-06-14 Thread Jochem Maas
Ashley M. Kirchner wrote: > >I have a form with various fields on it that I want to make sure > aren't empty or the user didn't just hit the space bar or return (in a > text field). What's the best way to do this? Seems empty() will fail > on a textarea if the user simply hits a space or ret

Re: [PHP] Checking for empty()

2006-06-14 Thread Stut
Ashley M. Kirchner wrote: I have a form with various fields on it that I want to make sure aren't empty or the user didn't just hit the space bar or return (in a text field). What's the best way to do this? Seems empty() will fail on a textarea if the user simply hits a space or return and

Re: [PHP] Checking for empty()

2006-06-14 Thread D. Dante Lorenso
Ashley M. Kirchner wrote: I have a form with various fields on it that I want to make sure aren't empty or the user didn't just hit the space bar or return (in a text field). What's the best way to do this? Seems empty() will fail on a textarea if the user simply hits a space or return and su

Re: [PHP] Checking for empty()

2006-06-14 Thread Ashley M. Kirchner
Brad Bonkoski wrote: Weel, since this is a PHP list I will assume you are checking once the page is posted/submitted... That would be correct. At the moment I'm checking with if (empty($_POST['var'])) { throw error flag } But as I read up on empty() I realized that if one simply hi

Re: [PHP] Checking for empty()

2006-06-14 Thread Brad Bonkoski
Weel, since this is a PHP list I will assume you are checking once the page is posted/submitted... off the top of my head, the functions strlen() and isset() come to mind. -Brad Ashley M. Kirchner wrote: I have a form with various fields on it that I want to make sure aren't empty or the

[PHP] Checking for empty()

2006-06-14 Thread Ashley M. Kirchner
I have a form with various fields on it that I want to make sure aren't empty or the user didn't just hit the space bar or return (in a text field). What's the best way to do this? Seems empty() will fail on a textarea if the user simply hits a space or return and submits the form. --

[PHP] Checking for empty values sent from a form

2003-03-06 Thread shaun
Is there an easy way to scan through an array of values sent from a form to see if any of them are empty? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php