RE: [PHP] One last try at this!

2007-01-18 Thread Beauford
> -Original Message- > From: Jim Lucas [mailto:[EMAIL PROTECTED] > Sent: January 17, 2007 8:10 PM > To: Jim Lucas > Cc: Beauford; 'PHP' > Subject: Re: [PHP] One last try at this! > > Jim Lucas wrote: > > Beauford wrote: > >> This is

Re: [PHP] One last try at this!

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 01:48:25 -0800: > Roman Neuhauser wrote: > ># [EMAIL PROTECTED] / 2007-01-17 17:02:12 -0800: > >>Beauford wrote: > >>> if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) { > >>> return "Invalid Characters"; > >>>} > > > >>In your regex you have a "." this will

Re: [PHP] One last try at this!

2007-01-18 Thread Jim Lucas
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-17 17:02:12 -0800: Beauford wrote: if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) { return "Invalid Characters"; } In your regex you have a "." this will match anything try this: That "." is inside a characte

Re: [PHP] One last try at this!

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-17 17:02:12 -0800: > Beauford wrote: > > if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) { > > return "Invalid Characters"; > >} > In your regex you have a "." this will match anything > > try this: > > > function ValidateString($string) { > i

Re: [PHP] One last try at this!

2007-01-17 Thread Jim Lucas
nt) ) !== false ) { $formerror['secondAttempt'] = $result; } var_dump($formerror); ?> Jim Lucas -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: January 17, 2007 4:36 PM To: Jay Blanchard Cc: Beauford; PHP Subject: Re: [PHP] One last try at this! Jay Blancha

Re: [PHP] One last try at this!

2007-01-17 Thread Jim Lucas
match anything try this: Jim Lucas -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: January 17, 2007 4:36 PM To: Jay Blanchard Cc: Beauford; PHP Subject: Re: [PHP] One last try at this! Jay Blanchard wrote: [snip] The second condition of each if s

RE: [PHP] One last try at this!

2007-01-17 Thread Beauford
D] > Sent: January 17, 2007 4:36 PM > To: Jay Blanchard > Cc: Beauford; PHP > Subject: Re: [PHP] One last try at this! > > Jay Blanchard wrote: > > [snip] > > > >> The second condition of each if statement does not contain > equality > >> c

Re: [PHP] One last try at this!

2007-01-17 Thread Jim Lucas
Jay Blanchard wrote: [snip] The second condition of each if statement does not contain equality checking, it sets the $result to ValidateString($event, "2"). That should be if($result == ValidateString($event, "2")) or if($result === ValidateString($event, "2")) What if the intension

RE: [PHP] One last try at this!

2007-01-17 Thread Jay Blanchard
[snip] > The second condition of each if statement does not contain equality > checking, it sets the $result to ValidateString($event, "2"). That > should be > if($result == ValidateString($event, "2")) or > if($result === ValidateString($event, "2")) > > What if the intension was to fail if the

Re: [PHP] One last try at this!

2007-01-17 Thread Jim Lucas
Jay Blanchard wrote: [snip] if(empty($orgname)) { $formerror['orgname'] = "Optional"; } elseif($result = ValidateString($orgname, "2")) { $formerror['orgname'] = $result; } if(empty($website)) { $formerror['website'] = "Optional"; } if($result = ValidateString($website, "2")) { $formerro

RE: [PHP] One last try at this!

2007-01-17 Thread Jay Blanchard
[snip] if(empty($orgname)) { $formerror['orgname'] = "Optional"; } elseif($result = ValidateString($orgname, "2")) { $formerror['orgname'] = $result; } if(empty($website)) { $formerror['website'] = "Optional"; } if($result = ValidateString($website, "2")) { $formerror['website'] = $result;

RE: [PHP] One last try at this!

2007-01-17 Thread Beauford
Your right. I have been sitting here at this computer for 3 days straight with all the various problems, and I missed this. I need a break, I need a KitKat. Thanks to the list for all the help over the last couple of days. I'm going to watch CSI and get away from this. > Take a little closer

Re: [PHP] One last try at this!

2007-01-17 Thread Simon Forster
On 17 Jan 2007, at 17:38, Beauford wrote: if(empty($orgname)) { $formerror['orgname'] = "Optional"; } elseif($result = ValidateString($orgname, "2")) { $formerror ['orgname'] = $result; } if(empty($website)) { $formerror['website'] = "Optional"; } if($result = ValidateString($website

Re: [PHP] One last try at this!

2007-01-17 Thread Jim Lucas
Beauford wrote: I hope I can explain this so I can get this figured out, 'cause if not I may just have to find an alternative to PHP. I can't be wasting 3 and 4 days on something as simple as this. Below are 3 validation routines. When I first enter the page 'Optional' is displayed for all of th

Re: [PHP] One last try at this!

2007-01-17 Thread Eric Butera
On 1/17/07, Beauford <[EMAIL PROTECTED]> wrote: I hope I can explain this so I can get this figured out, 'cause if not I may just have to find an alternative to PHP. I can't be wasting 3 and 4 days on something as simple as this. This isn't a very nice intro into asking a question on a mailing l

[PHP] One last try at this!

2007-01-17 Thread Beauford
I hope I can explain this so I can get this figured out, 'cause if not I may just have to find an alternative to PHP. I can't be wasting 3 and 4 days on something as simple as this. Below are 3 validation routines. When I first enter the page 'Optional' is displayed for all of them as it should be