dannerz Posted July 7, 2013 Share Posted July 7, 2013 <html> <head> <title> Intro Room </title> </head> <body> Welcome to the shop. <br /> To the left is how many of this you want to buy. <br /> To the right is what you want to buy. <br /> <br /> <form action="shop1b.php" method="post"> Amount of this you want to buy: <input type="text" <input name="unit"> What you want to buy: <select> <option value="archer">archer</option> <option value="immortal_archer">immortal_archer</option> <option value="shield_infantry">shield_infantry</option> <option value="immortal_shield_infantry">immortal_shield_infantry</option> </select> <input type="submit"> </form> Archers : 1 hp, 1 attack, 0 defense, 100$ each. <br /> Immortal archers same status but can't be destroyed. 1000$ each. <br /> Shield_Infantry 1 hp, 0 attack, 2 defense, 100$ each. <br /> Immortal shield infantry same status but can't be destroyed. 800$ each. <br /> </body> </html> This is the code^. I was hoping that which ever option you select, it would give that string to $_POST somehow. But I don't know how to do it yet. Quote Link to comment https://forums.phpfreaks.com/topic/279925-getting-a-string-to-_post-from-a-drop-down-list/ Share on other sites More sharing options...
dannerz Posted July 7, 2013 Author Share Posted July 7, 2013 I figured this out on my own. It requires simply that I put <select name="unit2" size="1"> So, the mods can lock this thread if they want. I'm glad I learned it. Quote Link to comment https://forums.phpfreaks.com/topic/279925-getting-a-string-to-_post-from-a-drop-down-list/#findComment-1439737 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.