Isi Scrip nya :
index.php
<!DOCTYPE html>
<html>
<head>
<title>kalkulator2</title>
<link rel="stylesheet" href="master.css" type="text/css" />
</head>
<body align="center">
<p style="">ARDI-IT TEKNOLOGI</p>
<table border="1" align="center" style="margin-top:50px;background:#0055FF;">
<form action="index.php" method="post">
<tr>
<td align="center" style="background:#00FFFF;">Kalkulator Sederhana</td>
</tr>
<tr>
<td>Bilangan Pertama :<input type="number" name="angka1"></input></td>
</tr>
<tr>
<td>Pilih Operator
<select name="operasi" required style="margin-left:113px;">
<option value="">Operator</option>
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
</td>
</tr>
<tr>
<td>Bilangan Kedua : <input type="number" name="angka2"></input> </td>
</tr>
<tr>
<td><input type="submit" name="hasil" value="Proses" style="background:#0000FF;"></input></td>
</tr>
<tr>
<td><input type="reset" name="reset" value="cancel" style="background:#0000FF;"></input></td>
</tr>
<tr>
<td style="background:#00FFFF;">
<?php
$angka1=$_POST['angka1'];
$angka2=$_POST['angka2'];
$operasi =$_POST['operasi'];
if ($operasi == '+') {
echo $angka1 + $angka2;
} elseif ($operasi == '-') {
echo $angka1 - $angka2;
} elseif ($operasi == '*') {
echo $angka1 * $angka2;
} elseif ($operasi == '/' ) {
echo $angka1 / $angka2 ;
}else
{
echo "Kosong Broo. . .";
}
?>
</td>
</tr>
</form>
</table>
</body>
</html>
index.php
<!DOCTYPE html>
<html>
<head>
<title>kalkulator2</title>
<link rel="stylesheet" href="master.css" type="text/css" />
</head>
<body align="center">
<p style="">ARDI-IT TEKNOLOGI</p>
<table border="1" align="center" style="margin-top:50px;background:#0055FF;">
<form action="index.php" method="post">
<tr>
<td align="center" style="background:#00FFFF;">Kalkulator Sederhana</td>
</tr>
<tr>
<td>Bilangan Pertama :<input type="number" name="angka1"></input></td>
</tr>
<tr>
<td>Pilih Operator
<select name="operasi" required style="margin-left:113px;">
<option value="">Operator</option>
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
</td>
</tr>
<tr>
<td>Bilangan Kedua : <input type="number" name="angka2"></input> </td>
</tr>
<tr>
<td><input type="submit" name="hasil" value="Proses" style="background:#0000FF;"></input></td>
</tr>
<tr>
<td><input type="reset" name="reset" value="cancel" style="background:#0000FF;"></input></td>
</tr>
<tr>
<td style="background:#00FFFF;">
<?php
$angka1=$_POST['angka1'];
$angka2=$_POST['angka2'];
$operasi =$_POST['operasi'];
if ($operasi == '+') {
echo $angka1 + $angka2;
} elseif ($operasi == '-') {
echo $angka1 - $angka2;
} elseif ($operasi == '*') {
echo $angka1 * $angka2;
} elseif ($operasi == '/' ) {
echo $angka1 / $angka2 ;
}else
{
echo "Kosong Broo. . .";
}
?>
</td>
</tr>
</form>
</table>
</body>
</html>
Isi Script master.css :
body{
background-color: #7FD4FF;
}
Sumber http://beritatecnologi.blogspot.combody{
background-color: #7FD4FF;
}
EmoticonEmoticon