E4_Grundstück - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of E4_Grundstück.php
- <!DOCTYPE html>
- <html lang="de">
- <head>
- <meta charset="utf-8" />
- <title>E4_Grundstück</title>
- </head>
- <body>
- <?php
- if (isset ( $_POST [" "] )) {
- $l = $_POST ["l"];
- $b = $_POST ["b"];
- $s = $_POST ["preis"];
- echo "<h1>Grundstückspreise</h1>";
- echo "Länge: ".$l. "Meter";
- echo "Breite: ".$b. "Meter";
- echo "Preis: ".$preis. "pro m²";
- //Grundstückspreis
- $nettopr = $l*$b*$preis;
- echo "Nettopreis: ".$nettopreis. "€";
- //Preis mit Provision
- $provpr = $nettopr+($nettopr*$prov/100);
- echo "mit Provision: ".$provpr. "€";
- if ($mwst==TRUE){
- $bruttopr = $provpr*1.19;
- }
- else {
- $bruttopr = $nettopr;
- }
- echo "Bruttopreis: ".$bruttopr. "€";
- }
- ?>
- <fieldset>
- <form method="post">
- <h1>Grundstückspreise</h1>
- <p>
- <label for="l">Länge in m: </label> <input type="Länge:" name="l"
- required placeholder=" Länge" autofocus />
- </p>
- <p>
- <label for="b">Breite in m: </label> <input type="Breite" name="b"
- required placeholder=" Breite" />
- </p>
- <p>
- <label for="preis">Preis pro m²: </label> <input type="Preis" name="preis"
- required placeholder=" Preis" />
- </p>
- </form>
- <p>
- <label for="prov">Provisionssatz:</label>
- <select id="prov" name="prov">
- <option value="3">3%</option>
- <option value="4">4%</option>
- <option value="5">5%</option>
- <option value="6">6%</option>
- <option value="7">7%</option>
- </select>
- </p>
- <p>
- <input type="checkbox" id="mwst" name="mwst" value="MWST" />
- <label for="mwst">MWST</label>
- </p>
- <p>
- <input type="submit" value="Berechnen" />
- </p>
- </fieldset>
- </body>
- </html>
File Description
- E4_Grundstück
- PHP Code
- 25 Sep-2020
- 1.76 Kb
You can Share it:
Latest PHP Pastes