Terimakasih telah berkunjung ke blog saya,
Baiklah Langsung saja,saya akan men share cara membuat kalkulator sederhana menggunakan adobe dreamweaver,,
1.Pastikan dreamweaver anda telah terinstall di PC/laptop anda, atau anda bisa menggunakan dreamweaver portable klik disini ,ekstract dulu file rar nya baru kemudian double klik file dreamweaver.exe
anda juga dapat menggunakan Notepadd++ untuk pengerjaan ini
2.xampp versi berapa pun
jika sudah ada dreamweaver kita lanjut kelangkah berikutnya
3.buat file form.php Copy code berikut:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="proses.php">
<table width="455" border="1">
<tr>
<td width="64">
nilai1</td>
<td width="375"><label for="nilai1"></label>
<input type="text" name="nilai1" id="nilai1" /></td>
</tr>
<tr>
<td>nilai2</td>
<td><label for="nilai2"></label>
<input type="text" name="nilai2" id="nilai2" /></td>
</tr>
<tr>
<td>operator</td>
<td><label for="select"></label>
<select name="operator" id="operator">
<option>+</option>
<option>-</option>
<option>*</option>
<option>/</option>
</select></td>
</tr>
<tr>
<td>Hasil</td>
<td><label for="hasil"></label>
<input type="text" name="hasil" id="hasil" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="button" id="button" value="Hitung" /></td>
</tr>
</table>
</form>
</body>
</html>
4.buatlah file proses.php Copy juga file berikut:
<?php
$nilai1 = $_POST['nilai1'];
$nilai2 = $_POST['nilai2'];
$operator = $_POST['operator'];
$hasil = $_POST['hasil'];
if ($operator == "+")
{
$hasil = $nilai1 + $nilai2;
}
else if ($operator == "-")
{
$hasil = $nilai1 - $nilai2;
}
else if ($operator == "*")
{
$hasil = $nilai1 * $nilai2;
}
else if ($operator == "/")
{
$hasil = $nilai1 / $nilai2;
}
?>
<table width="455" border="1">
<tr>
<td width="64">
nilai1</td>
<td width="375"><label for="nilai1"></label>
<?php echo "$nilai1";
?></td>
</tr>
<tr>
<td>nilai2</td>
<td><label for="nilai2"></label>
<?php echo "$nilai2";
?></td>
</tr>
<tr>
<td>operator</td>
<td><label for="select"></label>
<select name="select" id="select2">
</select></td>
</tr>
<tr>
<td>Hasil</td>
<td><label for="hasil"></label>
<?php echo $nilai1 . "$operator" . $nilai2 ."=". $hasil;
?>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="button" id="button" value="Hitung" /></td>
</tr>
</table>
</form>
</body>
</html>
Baiklah Langsung saja,saya akan men share cara membuat kalkulator sederhana menggunakan adobe dreamweaver,,
1.Pastikan dreamweaver anda telah terinstall di PC/laptop anda, atau anda bisa menggunakan dreamweaver portable klik disini ,ekstract dulu file rar nya baru kemudian double klik file dreamweaver.exe
anda juga dapat menggunakan Notepadd++ untuk pengerjaan ini
2.xampp versi berapa pun
jika sudah ada dreamweaver kita lanjut kelangkah berikutnya
3.buat file form.php Copy code berikut:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="proses.php">
<table width="455" border="1">
<tr>
<td width="64">
nilai1</td>
<td width="375"><label for="nilai1"></label>
<input type="text" name="nilai1" id="nilai1" /></td>
</tr>
<tr>
<td>nilai2</td>
<td><label for="nilai2"></label>
<input type="text" name="nilai2" id="nilai2" /></td>
</tr>
<tr>
<td>operator</td>
<td><label for="select"></label>
<select name="operator" id="operator">
<option>+</option>
<option>-</option>
<option>*</option>
<option>/</option>
</select></td>
</tr>
<tr>
<td>Hasil</td>
<td><label for="hasil"></label>
<input type="text" name="hasil" id="hasil" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="button" id="button" value="Hitung" /></td>
</tr>
</table>
</form>
</body>
</html>
4.buatlah file proses.php Copy juga file berikut:
<?php
$nilai1 = $_POST['nilai1'];
$nilai2 = $_POST['nilai2'];
$operator = $_POST['operator'];
$hasil = $_POST['hasil'];
if ($operator == "+")
{
$hasil = $nilai1 + $nilai2;
}
else if ($operator == "-")
{
$hasil = $nilai1 - $nilai2;
}
else if ($operator == "*")
{
$hasil = $nilai1 * $nilai2;
}
else if ($operator == "/")
{
$hasil = $nilai1 / $nilai2;
}
?>
<table width="455" border="1">
<tr>
<td width="64">
nilai1</td>
<td width="375"><label for="nilai1"></label>
<?php echo "$nilai1";
?></td>
</tr>
<tr>
<td>nilai2</td>
<td><label for="nilai2"></label>
<?php echo "$nilai2";
?></td>
</tr>
<tr>
<td>operator</td>
<td><label for="select"></label>
<select name="select" id="select2">
</select></td>
</tr>
<tr>
<td>Hasil</td>
<td><label for="hasil"></label>
<?php echo $nilai1 . "$operator" . $nilai2 ."=". $hasil;
?>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="button" id="button" value="Hitung" /></td>
</tr>
</table>
</form>
</body>
</html>
5.simpan File di C://Xampp//htdocs//(buat folder anda sendiri)
6.Jalankan Xampp seperti gambar berikut
7.Buka browser anda ketikkan di engine search localhost/(nama folder anda)
akan muncul file berikut
8.pilih form.php akan muncul form berikut:
9.isi form tersebut,,, jika muncul hasil yg benar,, maka calculator siaap digunakan ,,,
#GOOD LUCK#