I have wrote a code to calculate salaries. Total salary(net income) paid in gross income diminished by tax and pension insurance payment (4.30%). I have pasted the code. I didin’t get proper output
Calculate Salary<fieldset style="width: 30rem; border-style: double; border-width: 5px;">
<legend>Enter Salary Details</legend>
<form>
<label>Enter Gross Salary</label>
<input type="number" name="numsal"><br><br>
<label>Enter Tax</label>
<input type="number" name="numtax"><br><br>
<input type="submit" name="submit" value="Calculate">
<hr>
<?php
function calsalary($gross, $tax)
{
$calsalary = $gross - $tax - (4.30 * 100);
return $calsalary;
}
if (isset($_POST['submit']))
{
$net = $_POST['numsal'];
$saltax = $_POST['numtax'];
$total = calsalary($net,$saltax);
echo "You entered ".$net." as your Gross Salary";
echo $saltax." is tax which is deducted";
echo "<b>Your total salary is ".$total."</b>";
return 0;
}
?>
</form>
</fieldset>