呵呵,是刚开始学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;
?>
<form method="POST" action='submit.php'>
<input type=text name="amount">
<input type=text name="price">
</form>
//-----------submit.php--------------------
<?
echo $amount+$price;
?>
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>