我为我的 php 类做这个项目,我已经包含了代码。我无法弄清楚语法错误是什么。我已经改变了很多次,但没有任何效果。有人能帮我吗。谢谢!
<title>ordering form</title>
</head>
<body>
<h1>Welcome <?php echo $_POST['firstname']; ?> </h1>
<?php
if($_POST['sport'] == "gymnastics" && $_POST['gender'] == "men")
{
echo "You do not fit your category";
}
elseif($_POST['sport'] == "football" && $_POST['gender'] == "women")
{
echo "You do not fit your category";
}
else
{
echo "You fit your category";
}
?>
<?php
$mugcost = 4.95;
$taxrate = .08;
$mugcost = $mugcost * $_POST['quantity'];
$tax = $mugcost * $taxrate;
$mugcost = $mugcost + $tax;
$shipping = 5.99;
$finalcost = $shipping + $mugcost;
?>
<?php
echo "Your total cost is," $finalcost;
?>
</body>
</html>