Hi guys, Ive got a select box (select1) which has values 100, 200, 300 etc up to 1000. Below that is another select box (select2) with yes and no, if you select yes it takes 10% away from from the figure the user selected. What I need to do now is if the figure is less than 500 the figure is just 50 but if its greater then 500 it stays the same. I've done the code below but all it does is put 50 in the input box no matter what you choose. if ($_POST ["select2"] == "yes") {$select1 *=0.9;} if ($_POST ["select1"] <500) {$select1 = 50;} if ($_POST ["select1"] >500) {$select1 = $select1;} <input name="inputbox" value="<?php echo $select1 ?>" />
You have a logic flaw in your code and this may be the place to use the else { } statement. this page may help. http://www.developer.com/lang/php/article.php/938511