# [EMAIL PROTECTED] / 2007-01-21 10:48:30 +:
> # [EMAIL PROTECTED] / 2007-01-21 00:11:13 +0100:
> > Roman Neuhauser wrote:
> > > # [EMAIL PROTECTED] / 2007-01-17 16:59:26 +0100:
> > >> wouldn't it be fair to assume (safety through paranoia) that
> > >> ctype_alnum() would suffer the same proble
# [EMAIL PROTECTED] / 2007-01-21 00:11:13 +0100:
> Roman Neuhauser wrote:
> > # [EMAIL PROTECTED] / 2007-01-17 16:59:26 +0100:
> >> wouldn't it be fair to assume (safety through paranoia) that
> >> ctype_alnum() would suffer the same problem? (given the manual's
> >> indication that ctype_alnum() a
Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-17 16:59:26 +0100:
>> Roman Neuhauser wrote:
>>> re_format(7) on FreeBSD:
>>>
>>> A bracket expression is a list of characters enclosed in `[]'.
>>> (...)
>>> If two characters in the list are separated by `-', this is
>>> s
# [EMAIL PROTECTED] / 2007-01-17 16:59:26 +0100:
> Roman Neuhauser wrote:
> > re_format(7) on FreeBSD:
> >
> > A bracket expression is a list of characters enclosed in `[]'.
> > (...)
> > If two characters in the list are separated by `-', this is
> > shorthand for the full ran
Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-17 11:41:54 +0100:
>> Roman Neuhauser wrote:
>>> # [EMAIL PROTECTED] / 2007-01-17 01:42:09 +0100:
if (!preg_match("#^[A-Z0-9]+\$#i", $s)) {
(ps the above is a crappy regexp for real world use imho, but it serves
the purpose of
Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-17 11:41:54 +0100:
>> Roman Neuhauser wrote:
>>> # [EMAIL PROTECTED] / 2007-01-17 01:42:09 +0100:
if (!preg_match("#^[A-Z0-9]+\$#i", $s)) {
(ps the above is a crappy regexp for real world use imho, but it serves
the purpose of
# [EMAIL PROTECTED] / 2007-01-17 11:41:54 +0100:
> Roman Neuhauser wrote:
> > # [EMAIL PROTECTED] / 2007-01-17 01:42:09 +0100:
> >>if (!preg_match("#^[A-Z0-9]+\$#i", $s)) {
> >
> >> (ps the above is a crappy regexp for real world use imho, but it serves
> >> the purpose of example)
> >
> > I
Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-17 01:42:09 +0100:
>> Beauford wrote:
>>> Further to my previous email, there is something weird going on here. I just
>>> tried using this:
>>>
>>> if (!ereg('^[A-Za-z0-9]', $strvalue)) {
>>> return "error";
>>> }
>> stop
# [EMAIL PROTECTED] / 2007-01-17 01:42:09 +0100:
> Beauford wrote:
> > Further to my previous email, there is something weird going on here. I just
> > tried using this:
> >
> > if (!ereg('^[A-Za-z0-9]', $strvalue)) {
> > return "error";
> > }
>
> stop using bleeding ereg*()
> $formerror = array();
>
> ... do your validation here which may/may not add to the array.
>
> if (!empty($formerror)) {
>echo "Something went wrong!";
>print_r($formerror);
> } else {
>echo "Everything is ok!";
> }
As I said the problem is that a value is being returned, how I ch
Beauford wrote:
This is a bad way to test for a value also, unless you
expecting only TRUE or FALSE and you are sure that it will
always be set.
Otherwise you should do something like this
if ( isset($formerror) && $formerror != '' ) {
// Display Error
}
The problem here is this. for
Beauford wrote:
>
...
>>> function invalidchar($strvalue)
>>> {
>>> if(!ereg("^[[:alpha:][:space:]\'-.]*$", $strvalue)) {
>> That regexp matches if $strvalue consists of zero or more
>> ocurrences of a letter, a whitespace character, and any
>> character whose numeric value lies between
> This is a bad way to test for a value also, unless you
> expecting only TRUE or FALSE and you are sure that it will
> always be set.
> Otherwise you should do something like this
>
> if ( isset($formerror) && $formerror != '' ) {
> // Display Error
> }
The problem here is this. formerr
breaks the above if.
I hope this helps.
Thanks
-Original Message-----
From: Roman Neuhauser [mailto:[EMAIL PROTECTED]
Sent: January 16, 2007 5:49 AM
To: Beauford
Cc: 'PHP'
Subject: Re: [PHP] I lied, another question / problem
# [EMAIL PROTECTED] / 2007-01-15 19:22:24 -0500:
Fr
2007 5:49 AM
> To: Beauford
> Cc: 'PHP'
> Subject: Re: [PHP] I lied, another question / problem
>
> # [EMAIL PROTECTED] / 2007-01-15 19:22:24 -0500:
> > > From: 'Roman Neuhauser' [mailto:[EMAIL PROTECTED] #
> > > [EMAIL PROTECTED] / 2007-01
# [EMAIL PROTECTED] / 2007-01-15 19:22:24 -0500:
> > From: 'Roman Neuhauser' [mailto:[EMAIL PROTECTED]
> > # [EMAIL PROTECTED] / 2007-01-15 18:33:31 -0500:
> > > > From: Roman Neuhauser [mailto:[EMAIL PROTECTED] #
> > > > [EMAIL PROTECTED] / 2007-01-15 16:31:32 -0500:
> > > > > I have file which
n if I don't return anything it still gets a value.
Basically
this has just broken my whole site.
If anyone can figure this out let me know, right now I just have to
put this
site up with no validation.
Thanks
-Original Message-
From: Beauford
Sent: January 15, 2007 10:26 PM
To:
s a value. Basically
this has just broken my whole site.
If anyone can figure this out let me know, right now I just have to put this
site up with no validation.
Thanks
> -Original Message-
> From: Beauford
> Sent: January 15, 2007 10:26 PM
> To: 'PHP'
> Subject:
ect: RE: [PHP] I lied, another question / problem
>
>
>
> > -Original Message-
> > From: 'Roman Neuhauser' [mailto:[EMAIL PROTECTED]
> > Sent: January 15, 2007 7:53 PM
> > To: Beauford
> > Cc: 'PHP'
> > Subject: Re: [P
> -Original Message-
> From: 'Roman Neuhauser' [mailto:[EMAIL PROTECTED]
> Sent: January 15, 2007 7:53 PM
> To: Beauford
> Cc: 'PHP'
> Subject: Re: [PHP] I lied, another question / problem
>
> # [EMAIL PROTECTED] / 2007-01-15 18:33:31 -0500
> -Original Message-
> From: Roman Neuhauser [mailto:[EMAIL PROTECTED]
> Sent: January 15, 2007 7:09 PM
> To: Beauford
> Cc: PHP
> Subject: Re: [PHP] I lied, another question / problem
>
> # [EMAIL PROTECTED] / 2007-01-15 16:31:32 -0500:
> > I have f
# [EMAIL PROTECTED] / 2007-01-15 18:33:31 -0500:
> > From: Roman Neuhauser [mailto:[EMAIL PROTECTED]
> > # [EMAIL PROTECTED] / 2007-01-15 16:31:32 -0500:
> > > I have file which I use for validating which includes the following
> > > function:
> > >
> > > function invalidchar($strvalue)
> > > {
>
> -Original Message-
> From: Roman Neuhauser [mailto:[EMAIL PROTECTED]
> Sent: January 15, 2007 7:09 PM
> To: Beauford
> Cc: PHP
> Subject: Re: [PHP] I lied, another question / problem
>
> # [EMAIL PROTECTED] / 2007-01-15 16:31:32 -0500:
> > I have f
# [EMAIL PROTECTED] / 2007-01-15 16:31:32 -0500:
> I have file which I use for validating which includes the following
> function:
>
> function invalidchar($strvalue)
> {
> if(!ereg("^[[:alpha:][:space:]\'-.]*$", $strvalue)) {
That regexp matches if $strvalue consists of zero or more ocurre
24 matches
Mail list logo