2
0

Compare commits

...

4 Commits

Author SHA1 Message Date
Schuledaniel
11a260008e add stuff of 16. Jan 26 2026-01-16 08:15:01 +01:00
Schuledaniel
ec20b28fc4 Update README.md 2026-01-14 14:17:15 +01:00
Schuledaniel
19c2ba6e1f task of LBT3 2026-01-14 14:04:25 +01:00
cwikladaniel
be93d16a61 learning school, task 4 not working 2026-01-13 10:42:20 +01:00
7 changed files with 238 additions and 8 deletions

View File

@@ -0,0 +1,111 @@
<?php
// WIP
// Caesar-Chiffre Funktion
function caesar($text, $shift) {
$textArr = str_split($text, 1);
// definition is gewohnheit aus angular
$textAscii = [];
$resAscii = [];
$resArr = [];
for($i = 0; $i > count($textArr); $i++){
// jeder buchstabe des textes wird zum array,
// in dessen ascii zeichen, $resAscii hinzugefügt
array_push($textAscii, ord($textArr[$i]));
// verschiebung
$resAscii[$i] =+ $shift;
// ascii buchstaben werden in ein wort gemacht
array_push($resArr, chr($resAscii[$i]));
}
// aus array ein wort machen
$result = implode("", $resArr);
$yo = print_r($textArr);
echo "<pre> $yo </pre>";
$yo = print_r($textAscii);
echo "<pre> $yo </pre>";
$yo = print_r($resAscii);
echo "<pre> $yo </pre>";
$yo = print_r($resArr);
echo "<pre> $yo </pre>";
return $result;
}
// Formularverarbeitung
$output = "";
$text = "";
$shift = 0;
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$text = $_POST["text"] ?? "";
$shift = intval($_POST["shift"] ?? 0);
if (isset($_POST["encrypt"])) {
$output = caesar($text, $shift);
}
if (isset($_POST["decrypt"])) {
$output = caesar($text, -$shift);
}
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Caesar Chiffre</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f4f4f4;
padding: 30px;
}
.box {
background: white;
padding: 20px;
max-width: 500px;
margin: auto;
border-radius: 8px;
}
textarea, input {
width: 100%;
padding: 10px;
margin-bottom: 10px;
}
button {
padding: 10px 20px;
margin-right: 10px;
}
label{
display: block;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="box">
<h2>Caesar Chiffre</h2>
<form method="post">
<label for="text">Nachricht:</label>
<textarea name="text" rows="4"><?= htmlspecialchars($text) ?></textarea>
<label>Verschiebung:</label>
<input type="number" name="shift" min = 1 max = 26 value="<?= htmlspecialchars($shift) ?>">
<!--<input type="number" name="shift" value="<?= htmlspecialchars($shift) ?>">-->
<button type="submit" name="encrypt">Verschlüsseln</button>
<button type="submit" name="decrypt">Entschlüsseln</button>
<label for="result"> Verschlüsselte Nachricht:</label>
<textarea name="result" rows="4" readonly><?= htmlspecialchars($output ?: $text) ?></textarea>
</form>
</div>
</body>
</html>

View File

@@ -8,6 +8,12 @@ Wichtige Informationen
- Stundenplan - [Link](https://wvss-mannheim.webuntis.com/WebUntis/?school=wvss-mannheim#/basic/timetablePublic/class?entityId=2583)
## 16-01-26 - PHP
- Modulo
## 14-01-26 - PHP
- Kryptologie (LBT3)
## 12-12-25 - PHP (SQL)
- Aufgabe von gester überarbeitet
- Unterrichts Projekt:

View File

@@ -0,0 +1,27 @@
Sufix - Maske - Max IPs
/29 - / - 8
/28 - / - 16
/27 - / - 32
/26 - / - 64
/25 - 255.255.255.128 - 128
/24 - 255.255.255.0 - 255
/23 - 255.255.254.0 - 511
/22 - 255.255.252.0 - 1024
/21 - 255.255.248.0 - 2048
/20
---
bsp. /21 -> 21x 1
Dez - Binär - Anzahl 1
255 - 1111 1111 - 8
255 - 1111 1111 - 8
248 - 1111 1000 - 5
128|64|32|16 | 8|4|2|1

View File

@@ -0,0 +1,59 @@
# VLSM Übung
## Übung 1
Netz: 10.10.32.0/20
Netze zu erstellen:
A - 1022 /22
B - 400 /23
C - 63 /25
D - 12 /28
Sonstige Anweisungen
Nach größe Sortieren
### Netz A:
10.10.32.0/21 - 10.10.39.255
Subnetsmaske:
255.255.248.0
#### Rechnung
Subnetzmaske:
Address in Binär
0000 1010 . 0000 1010 . 0010 0000 . 0000 0000
Letzte Adresse (in Binär & Normal)
0000 1010 . 0000 1010 . 0010 0111 . 1111 1111
10.10.39.255
Subnetmaske in Binär
1111 1111 . 1111 1111 . 1111 1000 . 0000 0000
### Netz B:
10.10.40.0/23 - 10.10.41.255
255.255.254.0
### Netz C:
10.10.42.0/25 - 10.10.42.127
255.255.255. 1000 0000 -> 128
10.10.42. 0111 1111 -> 127
### Netz D:
10.10.42.128/28 - 10.10.42.143
255.255.255. 1111 0000 -> 240 (Subnetzmaske)
10.10.42. 1000 1111 (Bis IP)
> Info zur Bis IP
> Alle 1 wurden zu 0 und alle 0 wurden zu 1 aber
> nicht in der 4 Gruppe sondern nun in der 8 Gruppe
Vergleich Von - Bis (Binär)
10.10.42.
0000 1010 . 0000 1010 . 0010 1010 . 0111 1111
0000 1010 . 0000 1010 . 0010 1010 . 1000 1111

26
Zweites Jahr/modulo.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
$ergebnis = (int)(7/2);
echo $ergebnis."<br>";
$ergebnis = 7%3;
echo "Restwert: ".$ergebnis."<br>";
// Ist ZAhl gerade?
$zahl = 5;
if($zahl % 2 == 0)echo "$zahl is gerade.<br>";
else echo "$zahl ist ungerade.<br>";
// LEtze Zahl einer ZAhl ermitteln
$zahl = 123;
echo $zahl % 10; // In Zahl steht 3 wenn $zahl%=3
echo "<br>".$zahl."<br>";
echo (int)($zahl/10); // 123 -> 12

View File

@@ -34,7 +34,7 @@ Implementiere eine Bestellfunktion, die:
## File Handling Aufgaben
### Aufgabe 3: Log-System (TXT)
### Aufgabe 3: Log-System (TXT) X
Entwickle ein mehrstufiges Logging-System:

View File

@@ -5,6 +5,8 @@
// ###########
// geht nicht!
ini_set("display_errors", "on");
// Datei
$file = "produkt.csv";
@@ -13,18 +15,15 @@ if(!file_exists($file)){
// Beende das Skript
}
$fp = @fopen($file, 'r'); // a -> all (read, write ...)
$fp = @fopen($file, 'r');
if(!$fp){
die("Error while opening file!");
}
$header = fgetcsv($fp, 0, ",");
$header = fgetcsv($fp);
fclose($fp);
// READ FILE
$fp = @fopen($file, "W");
// READ FILE <- GEHT NICHT
$yo = print_r($header);
echo "<pre> $yo </pre>";
@@ -38,8 +37,10 @@ while(!feof($fp)){ // solange nicht das Ende der Datei erreicht ist
echo "<p> -------------------------------- </p>";
}
// WRITE TO FILE
fclose($fp);
// WRITE TO FILE <- GEHT
// $fp = @fopen($file, "W");
//$row = [7, "NZXTKeyboard", 120, "Tastatur"];
// file, data (array), seperator
//fputcsv($fp, $row, ",");