please help me to shorten the code if it si possible. It is working correctly but to echo all the elements of the salary I have to repeat this:
$pensjaBrutto = $_GET['pensjaBrutto'];
Is it possible to omit this repetition?
here is the code:
<form method="get" action="">
<meta charset="UTF-8">
<label>Wprowadź kwotę zarobków <u>brutto</u></label>
<br>
<input type="text" name="pensjaBrutto" value="<?=(isset( $_GET['pensjaBrutto'] ))?$_GET['pensjaBrutto']:''?>"/>
<br>
<input type="submit" />
</form>
<?php
if( isset( $_GET['pensjaBrutto'] ) ){
echo "Wynagrodzenie brutto: PLN ".$pensjaBrutto = $_GET['pensjaBrutto'];
$pensjaNetto = $pensjaBrutto *=0.703;
echo "<br>Wynagrodzenie netto: $pensjaNetto PLN";
$pensjaBrutto = $_GET['pensjaBrutto'];
$sklzdr = $pensjaBrutto *=0.078;
echo "<br>Skł zdrowotna: $sklzdr PLN";
$pensjaBrutto = $_GET['pensjaBrutto'];
$ubechor = $pensjaBrutto *=0.025;
echo "<br>Ubez chorobowe: $ubechor PLN";
$pensjaBrutto = $_GET['pensjaBrutto'];
$uberent = $pensjaBrutto *=0.015;
echo "<br>Ubez rentowe: $uberent PLN";
$pensjaBrutto = $_GET['pensjaBrutto'];
$ubeemer = $pensjaBrutto *=0.098;
echo "<br>Ubez emerytalne: $ubeemer PLN";
$pensjaBrutto = $_GET['pensjaBrutto'];
$zalpit = $pensjaBrutto *=0.081;
echo "<br>Zaliczka na PIT: $zalpit PLN";
}
?>