php新手问题,求大神指点
<html><head><metacharset="UTF-8"><title>Title</title></head><body><formaction="proces...
<html ><head><meta charset="UTF-8"><title>Title</title></head><body><form action="processorder.php" method="post"><table border="0"><tr bgcolor="#cccccc"><td width="150">项目</td><td width="15" >数量</td></tr><tr><td>轮胎</td><td align="center"><input type=" text " name="tireqty" size="3" maxlength="3" /></td></tr><tr><td>汽油</td><td align="center"><input type="text" name="oilqty" size="3" maxlength="3" /></td></tr><tr><td>火花塞</td><td align="center"><input type="text"name="sparkqty" size="3" maxlength="3" /></td></tr><tr><td colspan="2"align="center"><input type="submit" value="提交订单"></td></tr></table></form></body></html>跳转到<html><head><title>bos's Auto Parts</title></head><h1>bos的汽车配件</h1><h2>排序结果</h2><body><?phperror_reporting(E_ALL || ~E_NOTICE);echo '<p>订单处理.';echo date('H:i,Js F');echo '</p>';?><?phpdate_default_timezone_set("Asia/Shanghai");//creste short variable name$tireqty=$_POST['tireqty'];$oilqty=$_POST['oilqty'];$sparkqty=$_POST['sparkqty'];echo '<p>你的订单如下: </p>';echo $tireqty.'轮胎<br />';echo $oilqty.'汽油<br />';echo $sparkqty.'火花塞<br />';$totalqty=0;$totalqty=$tireqty+$oilqty+$sparkqty;echo '项目:'.$totalqty.'<br />';$totalamount=0.00;define('TIREPRCE',100);define('OILPRICE',10);define('SPARKPRICE',4);$totalamount=$tireqty * TIREPRCE+ $oilqty * OILPRICE+ $sparkqty * SPARKPRICE;echo '小计:$'.number_format($totalamount,2).'<br />';$taxrate=0.10;//local sales rax is 10%$totalamount = $totalamount * (1+$taxrate);echo '总含税;$'.number_format($totalamount,2).'<br />';?></body></html>无法显示计算
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询