Php Code for Simple Interest

Php Code for Simple Interest Small Software………..Full html + php code……..

 <a href="?action=interest&x=500&y=5">intesrest</a>
<form>
 <input name=action value=minus>
 <input name=x value=500>
 <input name=y value=100>
 <input type=submit value=click></form>
<?php $action=$_GET['action'];
$x=$_GET['x'];
$y=$_GET['y'];
if($action=='add'){
echo $x+$y;
}
if($action=='minus'){
echo $x-$y;
}
if($action=='interest'){
echo profit($x, $y);
}
 function profit($total, $interest){
$i=$interest*$total/100;
return $i;
}
?>

Comments

comments