select prob.

From: Date: Sat, 03 Feb 2001 13:23:30 +0000
Subject: select prob.
Groups: php.general 
Request: Send a blank email to php-general+get-37951@lists.php.net to get a copy of this message
Hi all, I'm in trouble checking client's value passed via a web form ... In a web form I usally use for the input's name a array var like this: <input type=text name=form[name] .. <input type=text name=form[email] .. <select name=form[country]> <option value=NONE>Select your country <option value=NONE>------------------- <option value=US>United State <option value=UK>United Kingdom .... and to generally check if some value is missing I use a simple routine like this: $manca=array(); foreach($array as $key=>$valore){ if(empty($valore) || $valore=="NONE"){ $manca[$key]++; } } where if $manca is greater then zero means that not all value was set .. My prob is that it never detects if the var $valore is equal to NONE ... I think that is due by my select field but at this moment I don't see how to correctly check if the passed values from it is a real value (as US,UK, etc.) or not (as NONE) ... any ideas? many thanks in advance max ------------------- Please Help Puppies ------------------- x

« previous php.general (#37951) next »