2024/10/11
bmi
<html><head><title>YourBMI</title></head>
<body><center>
<form method=”post”action=”bmi.cgi”><br><br>
BMI<br>
<input type=”text”name=”your_weight”>kg<br>
/<br>
<input type=”text”name=”your_tall”>cm<br>
*<br>
<input type=”submit”value=”send”><br>
</form>
</center>
</body></html>
bmi.cgi
#!/usr/bin/perl
BEGIN{$|=1;print”Content-type:text/html\n\n”;open(STDERR,”>&STDOUT”);}
use CGI;
$query=new CGI;
$your_weight= $ query->param( ‘your_weight’ );
$your_tall= $ query->param( ‘your_tall’ );
$total = $your_weight/($your_tall*$your_tall) * 100;
print”<center><font size =\”7\\”>total、$total</font></center>”;
exit;
milage
<html><head><title>gasmailage</title></head>
<body><center>
<form method=”post”action=”bmi.cgi”><br><br>
gasmailage<br>
<input type=”text”name=”your_liter”>L<br>
/<br>
<input type=”text”name=”your_km”>km<br>
<br>
<input type=”submit”value=”send”><br>
</form>
</center>
</body></html>
#!/usr/bin/perl
BEGIN{$|=1;print”Content-type:text/html\n\n”;open(STDERR,”>&STDOUT”);}
use CGI;
$query=new CGI;
$gas_L= $query->param(‘gas_L’);
$gas_km= $query->param(‘gas_km’);
$total=$gas_L/($gas_km)*100;
print”<center><font size =\”7\\”>total、$total</font></center>”;
exit;