<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>
答案 0 :(得分:0)
忘记正确连接此行(现在使用全新的.
):
<?php
echo "Your total cost is," . $finalcost;
?>
答案 1 :(得分:0)
您缺少字符串连接运算符(.
)
<?php
echo "Your total cost is," .$finalcost;
^
?>
答案 2 :(得分:0)
在你上次echo
你错过了一段时间:
echo "Your total cost is,". $finalcost;
^^