php basic calculate the volume of a beam
inputted length, width, height
then its result will come out.
inputted length, width, height
then its result will come out.
<?php @$panjang = $_POST['panjang']; @$lebar = $_POST['lebar']; @$tinggi= $_POST['tinggi']; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <form action="#" method="POST"> <table> <h1>Menentukan volume balok</h1> <tr> <td>Masukkan panjang</td> <td>:</td> <td><input type="text" name="panjang" value="<?php echo $panjang; ?>"/></td> </tr> <tr> <td>Masukkan lebar</td> <td>:</td> <td><input type="text" name="lebar" value="<?php echo $lebar; ?>"/></td> </tr> <tr> <td>Masukkan tinggi</td> <td>:</td> <td><input type="text" name="tinggi" value="<?php echo $tinggi; ?>"/></td> </tr> <tr> <td></td> <td></td> <td><input type="submit" name="proses" value="proses"/></td> </tr> </table> </form> </body> </html> <?php $volume=$panjang*$lebar*$tinggi; echo"volume balok adalah <b>$volume</b><br>"; ?>
Tidak ada komentar:
Posting Komentar