<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link rel="stylesheet" href="css/bootstrap.min.css">
<title>Submitted</title>
</head>
<body>
<?php
$employeeName = $_POST["txt_name"];
$employeeEmail = $_POST["txt_email"];
$employeeCompany = $_POST["txt_cmp"];
$employeeDesignation = $_POST["slc_dsgn"];
$employeeSalary = $_POST["txt_slry"];
$employeeStatus = $_POST["status"];
$employeeReason = $_POST["msg_rsn"];
?>
<div class="container">
<table class="table table-inverse">
 <thead>
<tr>
  <th>#</th>
  <th>Employee Name</th>
  <th>Email Address</th>
  <th>Company</th>
  <th>Designation</th>
  <th>Salary</th>
  <th>Status</th>
  </tr>
 </thead>
 <tbody>
  <tr>
    <th scope="row">1</th>
    <td><?php echo($employeeName)?></td>
  <td><?php echo($employeeEmail)?></td>
  <td><?php echo($employeeCompany)?></td>
  <td><?php echo($employeeDesignation)?></td>
  <td><?php echo($employeeSalary)?></td>
  <td><?php echo($employeeStatus)?></td>
</tr>
 </tbody>
 </table>
 <?php
 if($employeeSalary > 20000){
 $percentage = 35;
  $loan = ($percentage / 100) * $employeeSalary;
  }
  ?>
  <?php
  if($employeeSalary > 30000){
  $percentage = 25;
   $loan = ($percentage / 100) * $employeeSalary;
  }
  ?>
  <?php
  if($employeeSalary > 40000){
  $percentage = 15;
  $loan = ($percentage / 100) * $employeeSalary;
  }
  ?>
   <div class="text-center display-4 bg-faded justify-content-around"> your Loan will be <?php echo($loan)?> as per your current salary </div>
   <p class="blockquote text-center justify-content-around"> <?php echo($employeeReason);?>
   <span class="blockquote-footer">Reason</span>
   </p>
   </div>
   </html>
this is my code i am little new to php when i open my page on local host it say undefine variable of $percentage even i am defining it on each and every single if condition and later then i am using it to get percentage of sallary but i have also tried to put that variable globally still it not changing it value for my conditions I do not know how to sort this out
P.s this question is so on change i have tried alot to find similar one but i could not get.
 
    