hs1945 Posted November 18, 2019 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> Link to comment Share on other sites More sharing options...
Mudsaf Posted November 19, 2019 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now