bmi calculator
<html><head><title>BMI calculator</title></head>
<body><center>
<h1>BMIcalculator</h1>
<form method=”post”action=”input.cgi”><br><br>
BMI calculator<br>
<br>
<label for=”weight”>your weight(kg):</label><br>
<input type=”text”name=”weight”><br><br>
<label for=”height”>your height”(cm):</label><br>
<input type=”text”name=”height”><br><br>
<input type=”submit” value=”送信する”><br>
<input type=”reset” value=”リセット”>
</form></center>
</body></html>
#!/usr/bin/perl
BEGIN{$|=1;print”Content-type:text/html\n\n”;open(STDERR,”>&STDOUT”);}
use CGI;
my$query=new CGI;
my$weight=$query->param(‘weight’);
my $height=$query->param(‘height’);
my $bmi=$weight/($height*$height)*100;
print”<center><font size=\”7\”>Your BMI is :$bmi</font></center>”;
exit;