Re: totally stumped...

From: Date: Fri, 16 May 2003 22:25:53 +0000
Subject: Re: totally stumped...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147989@lists.php.net to get a copy of this message
> echo '<select name="protein">'."\n"; > foreach($p_val as $value) { > $str = ($value != $_POST['protein']) ? "<option > value=\"$v\">" . > sprintf("%.1f", $v) . "g</option>" : "<option > value=\"$v\" > selected=\"selected\">" . sprintf("%.1f", $v) . > "g</option>"; > echo $str ."\n"; > } > echo "</select>\n"; your looping through $p_val as $value... then you are doing something with the $v variable when you assign $str... where does this $v come from?? > if I change $value to $v it's ok but if it's > anything other then $v it wigs out, what kind > of sense does that make? See my comment. John -- -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

« previous php.general (#147989) next »