Aufgabe 7 1) fertig
This commit is contained in:
1
M2/Beispiele/accesslog.txt
Normal file
1
M2/Beispiele/accesslog.txt
Normal 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
|
||||
16
M2/Beispiele/m2_7a_accesslog.php
Normal file
16
M2/Beispiele/m2_7a_accesslog.php
Normal 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);
|
||||
?>
|
||||
Reference in New Issue
Block a user