- Aufgabe aus PROG (UMDREHER.html und UMDREHER.php)

This commit is contained in:
danielvici123
2024-10-02 13:50:51 +02:00
parent aee03902ed
commit bff07dc7ae
3 changed files with 67 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UMDREHER</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="main">
<h1>UMDREHER</h1>
<form action="prog_a2.php">
<div class="div_input">
<label for="nr_1" class="l if">Nummer 1</label>
<input type="number" name="nummer_eins" id="nr1"><br>
</div>
<div class="div_input">
<label for="nr_2" class="l if">Nummer 2</label>
<input type="number" name="nummer_zwei" id="nr_2"><br>
</div>
<button type="submit">Tauschen</button>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UMDREHER</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="main">
<h1>UMDREHER</h1>
<?php
$nr_1 = $_REQUEST['nummer_eins']; // 5
$nr_2 = $_REQUEST['nummer_zwei']; // 10
$nr_tausch = $nr_1;
// 10 10
//5 5
$nr_1 = $nr_2;
// 5 10
$nr_2 = $nr_tausch;
echo "
<div class='div_input'>
<label for='nr_1' class='l if'>Nummer 1:<label class='dr'>". $nr_1."</label></label>
<br><label for='nr_2' class='l if'>Nummer 2: <label class='dr'>". $nr_2."</label></label>
</div>
"
?>
</div>
</body>
</html>

View File

@@ -1,3 +1,7 @@
.div_input{
padding: 10px;
}
body {
background-color: cornflowerblue;
margin: 2px;
@@ -20,9 +24,13 @@ button:hover{
width: 98px;
}
input {
background-color: azure;
border: 2px solid black;
background-color: white;
border: 5px outset black;
border-radius: 24px;
width: 180px;
height: 20px;
box-shadow: 0px 0px 5px 5px blue;
margin-left: 10px;
}
.main {
border: 5px;