呵呵,是刚开始学PHP吗?//------------page.html---------------------
<form method="POST" action='submit.php'>
    <input type=text name="amount">
    <input type=text name="price">
</form>
//-----------submit.php--------------------
<?
echo $amount+$price;
?>

解决方案 »

  1.   

    簡單   输入数量和单价后的用javascript 執行一事件取出document中的值進行計算就可
      

  2.   

    <script language=javascript>
    function calinput(){
    document.mainform.result.value=document.mainform.quantity.value*document.mainform.price.value;
    }
    </script>
    <form method=post name=mainform>
    数量<input type=text name=quantity size=10 onchange="calinput();"><br>
    价格<input type=text name=price size=10 onchange="calinput();"><br>
    金额<input type=text name=result size=10><br>
    </form>