PHP Loan Calculator .
index.zip | |
File Size: | 1 kb |
File Type: | zip |
Simple calculator using php.
Hi dear friends, in this tutorial we are learn how to make a very simple calculator
in this post i,m show you that you self made a calculator for your site ,
1:- create a file with index.php.
2:- code the html and php,
coding here
<html>
<head>
<title>simple calculator</title>
</head>
<body>
<form method="POST">
<input name="1st" />
<input name="2st" />
<select name="action" >
<option value="+">+</option>
<option value="-">-</option>
<option value="*">x</option>
<option value="/">/</option>
</select>
<input name="sub" value="calculte"/>
</form>
</body>
</html>
<?php
if(isset($_POST['sub'])){
$v1=$_POST['1st'];
$v2=$_POST['2st'];
$action=$_POST['action'];
if($action== "+"){
$a=$v1+$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
if($action== "-"){
$a=$v1-$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
if($action== "*"){
$a=$v1*$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
if($action== "/"){
$a=$v1/$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
}
?>
DOWNLOAD THIS PROJECT INTO FLASH
in this post i,m show you that you self made a calculator for your site ,
1:- create a file with index.php.
2:- code the html and php,
coding here
<html>
<head>
<title>simple calculator</title>
</head>
<body>
<form method="POST">
<input name="1st" />
<input name="2st" />
<select name="action" >
<option value="+">+</option>
<option value="-">-</option>
<option value="*">x</option>
<option value="/">/</option>
</select>
<input name="sub" value="calculte"/>
</form>
</body>
</html>
<?php
if(isset($_POST['sub'])){
$v1=$_POST['1st'];
$v2=$_POST['2st'];
$action=$_POST['action'];
if($action== "+"){
$a=$v1+$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
if($action== "-"){
$a=$v1-$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
if($action== "*"){
$a=$v1*$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
if($action== "/"){
$a=$v1/$v2;
echo "Your Answer is" . " " . "<span 'color:red;font-size:22px'> $a</span>";
}
}
?>
DOWNLOAD THIS PROJECT INTO FLASH
index.zip | |
File Size: | 1 kb |
File Type: | zip |