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.

Archived

This topic is now archived and is closed to further replies.

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