ghfghgh - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of ghfghgh.php
- <html>
- <head><title></title></head>
- <body>
- <b>Заявка на получение ссуды. Кредитный банк Namllu</b>
- <?php
- if (isset($_POST['posted'])) {
- $duration = 0;
- switch ($_POST['loan']) {
- case "1000";
- $interest = 5;
- break;
- case "5000";
- $interest = 6.5;
- break;
- case "10000";
- $interest = 8;
- break;
- default:
- echo "Вы не выбрали вариант ссуды<hr>";
- exit;
- }
- while ($_POST['loan'] > 0)
- {
- $duration = $duration + 1;
- $monthly = $_POST['month'] - ($_POST['loan']*$interest/100);
- if ($monthly <= 0)
- {
- echo "Чтобы погасить ссуду, требуются более крупные
- ежемесячные платежи<hr>";
- exit;
- }
- $_POST['loan'] = $_POST['loan'] - $monthly;
- }
- echo "Для погашения ссуды при процентной ставке $interest процентов
- понадобится $duration месяцев.<hr>";
- }
- ?>
- <form method="POST" action="loan.php">
- <input type="hidden" name="posted" value="true">
- <br>
- Выберите необходимую сумму ссуды<br><br>
- <input name="loan" type="radio" value="1000">1000 долларов под 5,0% в месяц
- <br>
- <input name="loan" type="radio" value="5000">5000 долларов под 6,5% в месяц
- <br>
- <input name="loan" type="radio" value="10000">10000 долларов под 8,0% в месяц
- <br>
- <br>
- Введите сумму ежемесячного платежа
- <input name="month" type="text" size="5">
- <br>
- <br>
- <input type="submit" value="Рассчитать">
- </form>
- </body>
- </html>
File Description
- ghfghgh
- PHP Code
- 15 Apr-2022
- 1.52 Kb
You can Share it:
Latest PHP Pastes