saradrungta Posted November 25, 2008 Share Posted November 25, 2008 can any one help me how i can save name of chosen radio button in an array or session Link to comment https://forums.phpfreaks.com/topic/134219-solved-help/ Share on other sites More sharing options...
revraz Posted November 25, 2008 Share Posted November 25, 2008 Use the $_POST variable and save it? Link to comment https://forums.phpfreaks.com/topic/134219-solved-help/#findComment-698632 Share on other sites More sharing options...
dezkit Posted November 25, 2008 Share Posted November 25, 2008 Array the names, and then echo with a foreach Link to comment https://forums.phpfreaks.com/topic/134219-solved-help/#findComment-698644 Share on other sites More sharing options...
dezkit Posted November 25, 2008 Share Posted November 25, 2008 For example: index.php <form action="buy_snacks.php" method="post"> <select multiple name="snacks[ ]"> <option value="coke">CocaCola</option> <option value="popcorn">Popcorn</option> <option value="peanuts">Peanuts</option> </select> </form> buy_snacks.php $snacks = $_POST['snacks']; foreach ($snacks as $s) { echo "$s<br />"; } ?> Link to comment https://forums.phpfreaks.com/topic/134219-solved-help/#findComment-698655 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.