Voll Upload SGD Fachinformatiker PHP
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<title>Formular und Auswertung</title>
|
||||
<?php
|
||||
require("meinefunktionen.inc.php")
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
if(isset($_POST["zahl1"])){ //hier wird geprüft ob das Fomular schonmal ausgeführt wurde.
|
||||
$zahl1 = $_POST["zahl1"];
|
||||
$zahl2 = $_POST["zahl2"];
|
||||
$ergebnis = addiere($zahl1, $zahl2);
|
||||
echo "<p>Die Summe aus $zahl1 + $zahl2 beträgt $ergebnis!</p>\n";
|
||||
}
|
||||
?>
|
||||
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <!-- mit ?php echo $_SERVER["PHP_SELF"]; ?> wird der eigene dateipfadund bezeichnung ausgegeben -->
|
||||
<p>
|
||||
Bitte geben Sie die beiden Zahlen in die Felder ein, die Sie addieren möchten.
|
||||
</p>
|
||||
<p>
|
||||
<label for="zahl1">Zahl 1</label>
|
||||
<input type="text" name="zahl1" id="zahl1" placeholder="Zahl 1" required autofocus>
|
||||
</p>
|
||||
<p>
|
||||
<label for="zahl2">Zahl 2</label>
|
||||
<input type="text" name="zahl2" id="zahl2" placeholder="Zahl 2" required>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Addieren">
|
||||
<input type="reset" value="Reset">
|
||||
</p>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user