Aufgabe 7 1) fertig

This commit is contained in:
Robert
2023-11-07 13:03:30 +01:00
parent 0c360ccb99
commit 217a13bd52
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1 @@
07.11.2023 - 13:02 | 127.0.0.1 | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

View File

@@ -0,0 +1,16 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$logFile = fopen("accesslog.txt", "a");
$time = time();
$datum = date("d.m.Y - H:i", $time);
$write = $datum." | ".$ip." | ".$agent."\n";
fwrite($logFile, $write);
?>