I am new to php and html, and I am required to make a drop down list along with other inputs to create parameters which will be used in a perl script.
I need the drop down to upon submission set a variable = to what the user selected.
My code so far:
<HTML>
<?php
$value0 = "";
$value1 = "Banana";
$value2 = "Apple";
$value3 = "Orange";
$submittedValue;
?>
<select project="FruitList" id="FruitList">
<option value = <?php echo $value0; ?>><?php echo $value0; ?></option>
<option value = <?php echo $value1; ?>><?php echo $value1; ?></option>
<option value = <?php echo $value2; ?>><?php echo $value2; ?></option>
<option value = <?php echo $value3; ?>><?php echo $value3; ?></option>
<input type="submit" name="submit" id="submit" value="Submit" />
</form>
</HTML>
I am not sure how to use the submit button so that I can set the $submittedValue variable = to the selected value in the dropdown. HELP!!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…