hs1945 0 Posted November 18, 2019 Report Share Posted November 18, 2019 <!DOCTYPE HTML> <html> <head> <title>Rabattrechner</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> <body> <form action="" method="post"> <select name="anrede"> <option>Herr</option> <option>Frau</option> </select> <input type="text" name="name" placeholder="Name"><br> <input type="text" name="zugeh" placeholder="Zugehörigkeit (Jahre)"><br> <input type="text" name="lohn" placeholder="Bruttojahreslohn"><br> <input type="submit" value="abschicken"><br> <input type="hidden" name="hidden" value="hidden"> </form> <?php $cars = array('keines','Mittelklasse','gehobene Klasse','S Klasse'); echo $_POST['anrede'] . " " . $_POST['name']; echo "<br>Zugehörigkeit: " . $_POST['zugeh'] . " Jahre"; echo "<br>Gehalt: " . $_POST['lohn'] . "€"; if ($_POST['zugeh'] >= "5" && $_POST['zugeh'] < "15") { echo "<br>Fahrzeug: " . $cars[1]; echo "<br>Zuschuss: " . $_POST['lohn']*0.1 . "€"; } elseif ($_POST['zugeh'] >= "15" && $_POST['zugeh'] < "20") { echo "<br>Fahrzeug: " . $cars[2]; echo "<br>Zuschuss: " . $_POST['lohn']*0.13 . "€"; } elseif ($_POST['zugeh'] >= "20" ) { echo "<br>Fahrzeug: " . $cars[3]; echo "<br>Zuschuss: " . $_POST['lohn']*0.17 . "€"; $zus=$_POST['lohn']*0.17+2000 . "€"; echo "<br>Zuschuss mit Einmalzahlung von 2000€: " . $zus; } else { echo "<br>Fahrzeug: " . $cars[0]; } ?> </body> </html> Quote Link to post Share on other sites
Mudsaf 17 Posted November 19, 2019 Report Share Posted November 19, 2019 <?php echo "What kind of issue are you having? Mind telling us more whats wrong with the code (expected results and what you are getting)"; ?> 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.