whats with
if (isset($_POST['field']) && (INT)$_POST['field']>=0) {
? This should cover the requirements.
$_POST['field'] should be eq 0 or higher as int.
(INT) converts 1.44 to 1 (cuts .44)
-- Marco
2005/12/2, Jochem Maas <[EMAIL PROTECTED]>:
> Steve Edberg wrote:
> > At 5:30 PM +0100 12/1/05
Steve Edberg wrote:
At 5:30 PM +0100 12/1/05, Jochem Maas wrote:
Steve Edberg wrote:
Only problem with intval() is that it returns 0 (a valid value) on
I knew that. :-)
I figured so, but I thought I'd make it explicit for the mailing list...
failure, so we need to check for 0 first. Add
At 5:30 PM +0100 12/1/05, Jochem Maas wrote:
Steve Edberg wrote:
Only problem with intval() is that it returns 0 (a valid value) on
I knew that. :-)
I figured so, but I thought I'd make it explicit for the mailing list...
failure, so we need to check for 0 first. Adding more secure checks
Steve Edberg wrote:
Only problem with intval() is that it returns 0 (a valid value) on
I knew that. :-)
failure, so we need to check for 0 first. Adding more secure checks
do we? given that FALSE casts to 0.
would make this more than just a one-liner, eg;
$_CLEAN['x'] = false;
if (isset
Only problem with intval() is that it returns 0 (a valid value) on
failure, so we need to check for 0 first. Adding more secure checks
would make this more than just a one-liner, eg;
$_CLEAN['x'] = false;
if (isset($_POST['x'])) {
if (0 == 1*$_POST['x']) {
$_CLEAN['x'] = 0;
} else
Ray Hauge wrote:
Richard Lynch wrote:
On Wed, November 30, 2005 5:10 pm, Chris Lott wrote:
What is the shortest possible check to ensure that a field coming from
a form as a text type input is either a positive integer or 0, but
that also accepts/converts 1.0 or 5.00 as input?
$_CLEAN[
Richard Lynch wrote:
On Wed, November 30, 2005 5:10 pm, Chris Lott wrote:
What is the shortest possible check to ensure that a field coming from
a form as a text type input is either a positive integer or 0, but
that also accepts/converts 1.0 or 5.00 as input?
This might be good enoug
On Wed, November 30, 2005 5:10 pm, Chris Lott wrote:
> What is the shortest possible check to ensure that a field coming from
> a form as a text type input is either a positive integer or 0, but
> that also accepts/converts 1.0 or 5.00 as input?
This might be good enough:
if (isset($_POST['x'])){
What is the shortest possible check to ensure that a field coming from
a form as a text type input is either a positive integer or 0, but
that also accepts/converts 1.0 or 5.00 as input?
c
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
9 matches
Mail list logo