VB icon

Simple Interest Solver in PHP

Email
Submitted on: 11/26/2015 1:21:30 PM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: PHP 3.0, PHP 4.0, PHP 5.0
Views: 6349
author picture
 
     A simple program that I wrote in PHP to compute the interest rate of a loan of a customer or client. The code is very simple and easy to understand good for beginners in PHP programming. If you have some questions please send me an email at jake.r.pomperada@gmail.com and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: Simple Interest Solver in PHP
// Description:A simple program that I wrote in PHP to compute the interest rate of a loan of a customer or client. The code is very simple and easy to understand good for beginners in PHP programming.
If you have some questions please send me an email at jake.r.pomperada@gmail.com and jakerpomperada@yahoo.com. 
My mobile number here in the Philippines is 09173084360.
// By: Jake R. Pomperada
//**************************************

<?php
 error_reporting(0);
$principle = $_POST['principle'];
$rate = $_POST['rate'];
$time = $_POST['time'];
 
 
 if ($_POST['clear'])
{
$principle = "";
$rate = "";
$time = "";
$display_results = "";
}
 if ($_POST['compute']) 
 {
$interest =($principle*$rate*$time)/100;
$display_results = round($interest,2);
 }
?>
<html>
 <style>
 body {
 font-family:arial;
 font-size:12;
 }
</style>
<title> Simple Interest Solver in PHP</title>
<form action = "" method = "POST">
<body>
<h2> Simple Interest Solver in PHP </h2>
<br>
<table border = 3>
<tr>
<td> Principle Amount : </td>
<td> <input type = text name = "principle" value = "<?php echo $principle;?>" size="10" autofocus>
</tr>
<tr>
<td> Rate of Interest : </td>
<td> <input type = text name = "rate" value = "<?php echo $rate;?>" size="5">
</tr>
<tr>
<td> Time Period : </td>
<td> <input type = text name = "time" value = "<?php echo $time;?>" size="10" >
</tr>
<tr>
 <td>   </td>
</tr>
<tr>
<td>Interest Rate Php </td>
<td> <input type = text name = "solve_interest" value = "<?php echo $display_results;?>" size="12" readonly >
</tr>
<tr>
 <td>   </td>
</tr>
<td colspan = 3>
<input type = "submit" name="compute" value = "Compute Interest" title="Click here to compute for interest rate.">
<input type = "submit" name="clear" value = "Clear" title="Click here to clear text boxes.">
</td>
</tr>
</table>
</form>
 </body>
</html>


Other 56 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.