Hi, I am somewhat new to PHP and having a bit of trouble figuring out how to grab the value from a drop down menu from a form. Also I want to assign a number to the selected option. For Example, the person will select computer memory from the drop down menu and when they click the submit button it will echo the selected memory and the price. Whats the best way to do this? Thank You
pgmarco
0
Newbie Poster
Recommended Answers
Jump to PostHi,
<?php if(isset($_REQUEST['send'])) { $mydrodown = $_REQUEST['mydrodown']; echo "You have selected ".$mydrodown." from drop down."; exit; } ?> <form id="form1" name="form1" method="post" action=""> <select name="mydrodown"> <option value="computer memory">computer memory</option> <option value="computer parts">computer parts</option> <option value="computer peripherals">computer peripherals</option> </select> <input name="send" value="send" type="submit" /> </form>
Here i have …
All 4 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.