I'm trying to calculate prices with the values of true radio buttons. The aim is to multiply the number in the text box by the value of the user's choice. Here's the form:
<form action="calculate.php" method="post">
number: <input type="text" name="n" />
<br />
<input type="radio" name="1" value="110" /> option 1
<br />
<input type="radio" name="2" value="140" /> option 2
<br />
<input type="radio" name="3" value="200" /> option 3
<br />
<input type="submit" value="calculate"/>
</form>
Radio buttons name should be same if you want to choose a unique one.
<form action="calculate.php" method="post">
number: <input type="text" name="n" />
<br />
<input type="radio" name="opt" value="110" /> option 1
<br />
<input type="radio" name="opt" value="140" /> option 2
<br />
<input type="radio" name="opt" value="200" /> option 3
<br />
<input type="submit" value="calculate"/>
</form>
do this from PHP
$price = $_POST['opt'] * $_POST['n'];