RE: [PHP] Validating get and post data

2002-12-03 Thread Ford, Mike [LSS]
> -Original Message- > From: Beth Gore [mailto:[EMAIL PROTECTED]] > Sent: 03 December 2002 02:12 > > However bizarrely this seems to behave incorrectly, as it > cuts out "0" > as well. Can anyone explain why it does this? > > function stripnum($rawinput) > { > > for($x=0;$x

Re[2]: [PHP] Validating get and post data

2002-12-02 Thread Tom Rogers
Hi, Tuesday, December 3, 2002, 5:17:48 PM, you wrote: TR> Hi, TR> Tuesday, December 3, 2002, 12:12:09 PM, you wrote: BG>> Okay, I've just solved my own problem by simply doing: BG>> settype($input,"integer"); BG>> but.. I'm puzzled about why the following more complicated solution BG>> didn't

Re: [PHP] Validating get and post data

2002-12-02 Thread Tom Rogers
Hi, Tuesday, December 3, 2002, 12:12:09 PM, you wrote: BG> Okay, I've just solved my own problem by simply doing: BG> settype($input,"integer"); BG> but.. I'm puzzled about why the following more complicated solution BG> didn't work. The ASCII value for 0 is 48, and for 9 is 57. BG> The idea w

Re: [PHP] Validating get and post data

2002-12-02 Thread @ Edwin
"John W. Holmes" <[EMAIL PROTECTED]> wrote: > I think the problem is just the incorrect use of a switch. If you change > your code to > > switch(1) Or, switch(true) for that matter... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.p

RE: [PHP] Validating get and post data

2002-12-02 Thread John W. Holmes
> > I think what's happening here is a type issue. The comparison is > returning > a > > boolean, so when $c != '0', the switch is true and the case is resolving > to > > true, and executing. But when $c == '0', with switch is (false), but > the > > case is true. Change the case to > > ($c > chr(

Re: [PHP] Validating get and post data

2002-12-02 Thread @ Edwin
Hello, "Matt" <[EMAIL PROTECTED]> wrote: > I think what's happening here is a type issue. The comparison is returning a > boolean, so when $c != '0', the switch is true and the case is resolving to > true, and executing. But when $c == '0', with switch is (false), but the > case is true. Change

Re: [PHP] Validating get and post data

2002-12-02 Thread Matt
- Original Message - From: "Beth Gore" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 02, 2002 9:12 PM Subject: [PHP] Validating get and post data > Okay, I've just solved my own problem by simply doing: > > settype($input,"i

[PHP] Validating get and post data

2002-12-02 Thread Beth Gore
Okay, I've just solved my own problem by simply doing: settype($input,"integer"); but.. I'm puzzled about why the following more complicated solution didn't work. The ASCII value for 0 is 48, and for 9 is 57. The idea was to read a character at a time from the $rawinput string, check if it's w