I'm trying to get user input then make calculation based on the input.
Below is the main html. please help
<html>
<body>
Welcome there, <?php echo $_POST["name"]; ?>
<br><br>
---- YOUR SELECTION -----
<br><br>
<?php
$quantity = = echo $_POST["quantity"];
var_dump($quantity);
$bidprice = = echo $_POST["bidprice"];
var_dump($bidprice);
$total = = $quantity * $bidprice;
var_dump($total);
?>
Quantity selected: <?php echo $_POST["quantity"]; ?>
<br>
Bid price: <?php echo $_POST["bidprice"]; ?>
<br>
Total: <?php echo $total; ?>
</body>
</html>
Below is the form that replies based on input, but it can get the name but can't perform calculation. Why?
<html>
<body>
<form action="welcome_get.php" method="post">
What is your name?
<input type="text" name="name">
<br><br>
Quantity:
<input type="number" name="quantity">
<br>
Bid Price:
<input type="number" name="bidprice">
<br>
<input type="submit">
</form>
</body>
</html>
Ctrl-K. Then delete your commentsechoto declare variable values and only one=is necessary to perform a value assignment.$quantity = = echo $_POST["quantity"];, this is rather weird