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
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
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
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
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
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
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.
--
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
8 matches
Mail list logo