View Single Post
  #7 (permalink)  
Old November 3rd, 2003, 07:50 PM
wadesmart wadesmart is offline
Authorized User
 
Join Date: Oct 2003
Location: , Ok, .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So,

<?php
        $Principle = $_POST["loan"];
        $Duration = 0;
        switch ($Principle)
        {
            case 1000: $Interest = 5;
            break;

            case 5000: $Interest = 6.5;
            break;

            case 1000: $Interest = 8;
            break;

            default:
            echo "You didnt chose a loan package.";
            exit;
        }

        while ($Principle > 0 )
        {
            $Duration = $Duration + 1 ;
            $Monthly = $_POST["month"] - ($_POST["loan"] * $Interest / 100 ) ;
            if ($Monthly <= 0)
            {
                echo "You need larger monthly payments to pay off your loan." ;
            }
        $Principle = $Principle + $Monthly;
        }

            echo "This would take you $Duration months to pay this off at the interest rate of $Interest percent." ;
    ?>


Reply With Quote