Manuel,
Manuel Lemos <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| Hello boclair,
|
| On 05-Apr-01 01:58:24, you wrote:
|
| >I have a problem with a user input in a form required to be an
| >integer, creating a variable for a mysql query.
|
| >I have instance
Hello boclair,
On 05-Apr-01 01:58:24, you wrote:
>I have a problem with a user input in a form required to be an
>integer, creating a variable for a mysql query.
>I have instances where integer, 0, is being typed as letter,o.
>The last discussion of validating the input was
>http://marc.theaim
Ben Udall <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| boclair wrote:
| > I have a problem with a user input in a form required to be an
| > integer, creating a variable for a mysql query.
| >
| > I have instances where integer, 0, is being typed as letter,o
^^
Brad,
- Original Message -
From: Brad S. Jackson <[EMAIL PROTECTED]>
To: boclair <[EMAIL PROTECTED]>
Sent: Thursday, April 05, 2001 11:54 PM
Subject: Re: [PHP-DB] Forms : Validating user input is integer
>
>
> This is probably the most efficient way to check.
- Original Message -
From: Matt Williams <[EMAIL PROTECTED]>
To: Boclair <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 05, 2001 11:28 PM
Subject: RE: [PHP-DB] Forms : Validating user input is integer
The line should read, and as I tested it,
> &g
boclair wrote:
> I have a problem with a user input in a form required to be an
> integer, creating a variable for a mysql query.
>
> I have instances where integer, 0, is being typed as letter,o.
>
> The last discussion of validating the input was
> http://marc.theaimsgroup.com/?l=php-db&m=9720
> 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?
Yes, same thing it will accept other character like !*- etc...
try
if(!eregi("^[0-9]+[0-9]*$",$num)
{
//error
}
M@
--
PHP Database M
"Matt Williams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
|
| > 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 (ereg
> or even just
> elseif (!eregi("[^a-zA-Z]"),$num)) { }
But that would not stop other characters.
M@
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EM
ay, April 05, 2001 9:03 PM
| Subject: RE: [PHP-DB] Forms : Validating user input is integer
|
|
| >
| > > To gain the full benefit of your suggestion I find that I can
| validate
| > > for a wrong entry containing a mix alphabetical and numerical
| > > characters by altering
- Original Message -
From: Matt Williams <[EMAIL PROTECTED]>
To: boclair <[EMAIL PROTECTED]>
Sent: Thursday, April 05, 2001 9:03 PM
Subject: RE: [PHP-DB] Forms : Validating user input is integer
>
> > To gain the full benefit of your suggestion I find that I c
05, 2001 8:05 PM
Subject: RE: [PHP-DB] Forms : Validating user input is integer
> try elseif(!eregi("[0-9]",$num))
To gain the full benefit of your suggestion I find that I can validate
for a wrong entry containing a mix alphabetical and numerical
characters by altering the elseif line to
lidation was being with a javascript and
the creation of the variable was OK.
Further advise appreciated.
Tim
- Original Message -
From: Steve Farmer <[EMAIL PROTECTED]>
To: boclair <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 05, 2001 3:23 PM
Subj
Hi tim,
most certainly it can be done on the server side, it juts requires a
round trip to the server is all
i think it is ..
if(!isinteger($input_var)): (check the exact function in the php manual)
echo "this is an error (or whatever), press here to go back and
correct your inpout";
ex
I have a problem with a user input in a form required to be an
integer, creating a variable for a mysql query.
I have instances where integer, 0, is being typed as letter,o.
The last discussion of validating the input was
http://marc.theaimsgroup.com/?l=php-db&m=97207172003983&w=2
There it was
15 matches
Mail list logo