Jump to content

getting a string to $_POST from a drop-down list.


dannerz

Recommended Posts

<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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.