<?php
echo "<b>Hitung bagi</b>";
echo "<br>";
//$x=3;
//$y=5;
//$z=$x+$y;
echo "<form method='POST' action='bagi.php'>";
echo "<input type='text' name='x' placeholder='masukkan nilai x'></input>";
echo "<br>";
echo "<input type='text' name='y' placeholder='masukkan nilai y'></input>";
echo "<br>";
echo "<input type='submit' name='submit' value='hitung'></input>";
echo "<input type='reset' name='reset' value='reset'></input>";
echo "</form>";
echo "<br>";
if(isset($_POST['submit']))
{
$x=$_POST['x'];
$y=$_POST['y'];
$z=$x/$y;
echo "nilai x adalah:".$x;
echo "<br>";
echo "nilai y adalah:".$y;
echo "<br>";
echo "<b>hasil bagi x/y adalah ".$z."</b>";
}
?>
Selasa, 07 Mei 2019
Program Kalkulator Sederhana dengan PHP (Revisi) part 5
Code Program bagi.php

0 komentar:
Posting Komentar