basic as learning to use a simple mathematical formula
I am here as an example of using the formula to calculate the area and perimeter
of the triangle, and its results you just enter the area and perimeter of the results will appear
<?php @$nilai1 = $_POST['nilai1']; ?> <!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 luas dan keliling persegi</h1> <tr> <td>Masukkan sisi</td> <td>:</td> <td><input type="text" name="nilai1" value="<?php echo $nilai1; ?>"/></td> </tr> <tr> <td></td> <td></td> <td><input type="submit" name="proses" value="proses"/></td> </tr> </table> </form> </body> </html> <?php $luas=$nilai1*$nilai1; echo"luas persegi adalah <b>$luas</b><br>"; $keliling=4* $nilai1; echo"keliling persegi adalah <b>$keliling</b>"; ?>
Tidak ada komentar:
Posting Komentar