Re: Forms : Validating user input is integer
| From: | Boclair | Date: | Thu, 05 Apr 2001 12:53:36 +0000 |
| Subject: | Re: Forms : Validating user input is integer | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8270@lists.php.net to get a copy of this message | ||
"Matt Williams" <matt@yewlands.com> wrote in message
news:BKEBLPOMMAKCLHIBKBOECEHHDAAA.matt@yewlands.com...
|
| > or even just
| > elseif (!eregi("[^a-zA-Z]"),$num)) { }
|
| But that would not stop other characters.
|
| M@
Whoops! Careless of me. The line should read, and as I tested it,
elseif (eregi("[a-zA-Z]",$num)) { }
Do you see any problem with this?
I have tried with every type and mix of input that I can think of and
was successful in denying all but digit inputs, but I have little
confidence in what I am doing. With your examples I am at least
coming to some understanding of Dario Gomes article on PHPBuilder.
Tim