RE: HELP! form validation

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

 



> > > > Eg:
> > > > $error_style = 'color: rgb(255,0,0)';
> > > >  if(!$name){$err1 = $error_style; $error[]="*please enter
> > > > your name\n";}
> > > >
<snip!>
> > Does it re-populate the fields with the previously entered data? 
> 
> Yes, it does. I already have set the variables manually like 
> you say. Its
> just the $err1, $err2 vars do not seem to be set with the 
> data stored in
> $error_style.

This baffles me too then.  In your code above, if $name is not set, $err1
will be set to equal $error_style.  There is obviously more coming into play
than just this code snippet.  Double-check your variable names.  Place
strategically located 'echo' statements to see what is happening, for
instance, right after the above 'if' statement, place an 'echo $name;'.

JM

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