<style type="text/css">
<!--
.style1 {font-size: 12px}
.style2 {font-size:16px; color:#FF0000}
-->
</style>

<?
function bw($hn){
$std=$hn*$hn*22;
$ideal=$hn*$hn*19;
return array($std,$ideal);
}
?>

<form id="form1" name="form1" method="post" action="">
<p>請輸入身高以計算理想體重:
<input name="height" type="text" id="textfield" size="10" />公分
<input type="submit" name="button" id="button" value="確定" /></p>
</form>

<?
$height=isset($_POST['height'])?$_POST['height']:null;
$r_height=$height/100;
list($po_std,$po_ideal)=bw($r_height);
echo "<span>"."你的身高是:".$height."公分"."</span>";
echo "<br>";
echo "<span>"."標準理想體重是:"."</span>";
echo "<span>".$po_std."</span>";
echo "<span>"."公斤。"."</span>";
echo "<br>";
echo "<span>"."完美曲線理想體重:"."</span>";
echo "<span>".$po_ideal."</span>";
echo "<span>"."公斤。"."</span>";
?>



範例網頁

arrow
arrow
    全站熱搜

    ALVIN 發表在 痞客邦 留言(0) 人氣()