I created a form in which I want to enter a gross salary ($salBrut) and when I press the "Calculate" button, it shows me the $salNet, which is the NET salary.
So far the form automatically has nothing in the input text, and it gives me -299 result directly, without letting me calculate the desired salary! And even if I enter any value, it still won't read it...
What should I do in order to make it recognise my value entered in the ? $contributii are the taxes
Code is below:
<form method="get" action="">
<label>Introduceti salariul dvs. <u>brut</u></label>
<br>
<input type="text" name"salarBrut" value=""/>
<br>
<input type="submit" name="btn" value="Calculate!"/>
</form>
<?php
$salBrut = $_GET['salarBrut'];
$contributii = array("pensii" => 105,
"sanatate" => 55,
"somaj" => 5,
"impozit" => 134);
$totContrib = array_sum($contributii);
$salNet = $salBrut-$totContrib;
echo "Salariul net este $salNet";
?>