mirror of
https://github.com/janunger/rheinwerk-video-training.git
synced 2026-02-05 22:55:14 +01:00
Initiale Version
This commit is contained in:
7
Kapitel_8/Lektion_5/1_xss.php
Normal file
7
Kapitel_8/Lektion_5/1_xss.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// FALSCH!!!
|
||||
echo $eineVariable;
|
||||
|
||||
// Richtig
|
||||
echo htmlspecialchars($eineVariable);
|
||||
19
Kapitel_8/Lektion_5/2_formular.php
Normal file
19
Kapitel_8/Lektion_5/2_formular.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
if (isset($_POST['benutzername'])) {
|
||||
$benutzername = $_POST['benutzername'];
|
||||
} else {
|
||||
$benutzername = '';
|
||||
}
|
||||
|
||||
?>
|
||||
<form action="" method="post">
|
||||
|
||||
<!-- FALSCH!!! -->
|
||||
<input type="text" name="benutzername" value="<?= $benutzername; ?>"/>
|
||||
|
||||
<!-- Richtig -->
|
||||
<input type="text" name="benutzername" value="<?= htmlspecialchars($benutzername); ?>"/>
|
||||
|
||||
<input type="submit"/>
|
||||
</form>
|
||||
Reference in New Issue
Block a user