One last try at this!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, but when I click submit on the
form without entering any data, the first one displays optional (which it
should), but the 2nd and 3rd ones execute the elseif and the validation
routine says there are invalid characters in the string. If nothing is
entered in the form where is it getting a value???????????? It should never
get to the elseif to start with if nothing is entered in the form. So how
can I make a reliable check?

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; }

if(empty($event)) { $formerror['event'] = "Optional"; }
if($result = ValidateString($event, "2")) { $formerror['event'] = $result; }

Again, sorry to be a pain, but I just don't get it.

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux