joebudden Posted February 2, 2007 Share Posted February 2, 2007 Hi guys, i just want to know if this is possible, or if any one has a simple solution..... ok, iv got a form with a drop down box which has three values <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <select> <option>Heavy training with emphasis on strength and stamina</option> <option>Medium training with emphasis on fast paced attacking football</option> <option>Light training focused on quick passing and set piece play</option> </select> <input type="submit" value="Begin Training Session" /> </form> Say the user selects "Heavy training with emphasis on strength and stamina"..... is there any way of inserting a "1" into a database table and so on for the others??? Anyone know if its possible ??? thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/36764-solved-drop-down-boxes/ Share on other sites More sharing options...
ted_chou12 Posted February 2, 2007 Share Posted February 2, 2007 I think you need something like: <option value="test">Heavy training with emphasis on strength and stamina</option> you need the value= as well... Ted Quote Link to comment https://forums.phpfreaks.com/topic/36764-solved-drop-down-boxes/#findComment-175345 Share on other sites More sharing options...
joebudden Posted February 2, 2007 Author Share Posted February 2, 2007 hmmmm so I have <select> <option value="1">Heavy training with emphasis on strength and stamina</option> <option value="2">Medium training with emphasis on fast paced attacking football</option> <option value="3">Light training focused on quick passing and set piece play</option> </select> but then how would I implement if(isset statements to insert the values into my DB??? Il have a look on the net but if anyone knows please reply!!! cheers Quote Link to comment https://forums.phpfreaks.com/topic/36764-solved-drop-down-boxes/#findComment-175350 Share on other sites More sharing options...
ted_chou12 Posted February 2, 2007 Share Posted February 2, 2007 <?php if(isset($_POST['submit'])){ $type = $_POST['type']; //...mysql insert or whatever you want... } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <select name="type"> <option>Heavy training with emphasis on strength and stamina</option> <option>Medium training with emphasis on fast paced attacking football</option> <option>Light training focused on quick passing and set piece play</option> </select> <input type="submit" name="submit" value="Begin Training Session" /> </form> I think thats basically it. Ted Quote Link to comment https://forums.phpfreaks.com/topic/36764-solved-drop-down-boxes/#findComment-175405 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.