RE: [PHP] HELP! form validation

From: Date: Thu, 09 Jun 2005 14:02:09 +0000
Subject: RE: [PHP] HELP! form validation
Groups: php.general 
Request: Send a blank email to php-general+get-216717@lists.php.net to get a copy of this message
> > Hi Jim, Ive modified the code for the form by adding the > style info & vars > to the relevant fields and set the var for the error style > but for some > reason the $error_var wont pick up the syle from $error_syle_var. > > Eg: > $error_style = 'color: rgb(255,0,0)'; > if(!$name){$err1 = $error_style; $error[]="*please enter > your name\n";} > > $err1 does not pick up $error_style in the actual form and I just get > style="" instead of style="color: rgb(255,0,0)". Im a tad > baffled and im > sure its something simple that im missing. > > Any ideas? > Does it re-populate the fields with the previously entered data? If not, register_globals might be off, and you'll have to set the variables manually: $name=$_POST['name']; ...or use them directly: if (!$_POST['name']){...} JM

« previous php.general (#216717) next »