mirror of
https://github.com/janunger/rheinwerk-video-training.git
synced 2026-02-06 07:05:14 +01:00
Initiale Version
This commit is contained in:
31
Kapitel_5/Lektion_7/protokoll_loesung/index.php
Executable file
31
Kapitel_5/Lektion_7/protokoll_loesung/index.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
function protokoll($text)
|
||||
{
|
||||
$datum = date('Y-m-d H:i:s');
|
||||
$eintrag = $datum . ': ' . $text . PHP_EOL;
|
||||
|
||||
$datei = fopen(__DIR__ . '/protokoll.txt', 'a');
|
||||
fwrite($datei, $eintrag);
|
||||
fclose($datei);
|
||||
}
|
||||
|
||||
if (isset($_GET['link'])) {
|
||||
protokoll('Link ' . htmlspecialchars($_GET['link']) . ' wurde geklickt.');
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Log</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p><a href="?link=1">Link 1</a></p>
|
||||
<p><a href="?link=2">Link 2</a></p>
|
||||
<p><a href="?link=3">Link 3</a></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user