WIP: skipass task
This commit is contained in:
@@ -31,7 +31,7 @@ $now = date(DATE_RFC2822, time()); // current time
|
|||||||
$userIP = $_SERVER['REMOTE_ADDR'] ; // users ip
|
$userIP = $_SERVER['REMOTE_ADDR'] ; // users ip
|
||||||
|
|
||||||
$file = "access_log.txt";
|
$file = "access_log.txt";
|
||||||
$fp = fopen($file, 'a') or die ("Cannot open file"); // open file for writing
|
$fp = fopen($file, 'r') or die ("Cannot open file"); // open file for writing
|
||||||
|
|
||||||
if (countLines($file) < 2) {
|
if (countLines($file) < 2) {
|
||||||
$txt = "Count | Date | IP\n";
|
$txt = "Count | Date | IP\n";
|
||||||
|
|||||||
BIN
Zweites Jahr/skipass/AB_Skipass.pdf
Executable file
BIN
Zweites Jahr/skipass/AB_Skipass.pdf
Executable file
Binary file not shown.
16
Zweites Jahr/skipass/LogSkipass.txt
Executable file
16
Zweites Jahr/skipass/LogSkipass.txt
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
Jan 09 2016|09:15:17|30201|1|SL02|650
|
||||||
|
Jan 09 2016|09:15:18|43097|1|SL01|945
|
||||||
|
Jan 09 2016|09:15:19|28774|2|SB03|1389
|
||||||
|
Jan 09 2016|09:16:21|00788|1|SL02|650
|
||||||
|
Jan 09 2016|09:17:25|03361|3|SL01|945
|
||||||
|
Jan 09 2016|09:17:33|08385|1|SL02|650
|
||||||
|
Jan 09 2016|09:18:43|10234|1|SL01|945
|
||||||
|
Jan 09 2016|09:21:55|00788|1|SL02|650
|
||||||
|
Jan 09 2016|09:24:43|03361|3|SB03|1389
|
||||||
|
Jan 09 2016|09:26:01|30201|1|SB03|1389
|
||||||
|
Jan 09 2016|09:26:21|28774|2|SL02|650
|
||||||
|
Jan 09 2016|09:26:25|00788|1|SL02|650
|
||||||
|
Jan 09 2016|09:27:21|28774|2|SL02|650
|
||||||
|
Jan 09 2016|09:29:32|30201|1|SL01|945
|
||||||
|
Jan 09 2016|09:30:12|34032|1|SB03|1389
|
||||||
|
Jan 09 2016|09:30:15|08767|3|SL02|650
|
||||||
59
Zweites Jahr/skipass/skipass.php
Normal file
59
Zweites Jahr/skipass/skipass.php
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
$now = date(DATE_RFC2822, time()); // current time
|
||||||
|
$userIP = $_SERVER['REMOTE_ADDR'] ; // users ip
|
||||||
|
|
||||||
|
$file = "access_log.txt";
|
||||||
|
$fp = fopen($file, 'a') or die ("Cannot open file"); // open file for writing
|
||||||
|
|
||||||
|
if (countLines($file) < 2) {
|
||||||
|
$txt = "Count | Date | IP\n";
|
||||||
|
fwrite($fp, $txt);
|
||||||
|
$count = countLines($file);
|
||||||
|
$txt = "$count | $now | $userIP\n";
|
||||||
|
fwrite($fp, $txt);
|
||||||
|
echo countLines($file) -1;
|
||||||
|
} else {
|
||||||
|
$count = countLines($file) - 1;
|
||||||
|
$txt = "$count | $now | $userIP\n";
|
||||||
|
fwrite($fp, $txt);
|
||||||
|
echo countLines($file) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function countLines($currentFile){
|
||||||
|
return count(file($currentFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($fp);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function getLiftLength(string $dataName,int $passID):int {
|
||||||
|
$file = "LogSkipass.txt";
|
||||||
|
$fp = file(fopen($file, 'a')or die($result = 0)); // file opened and made to an array
|
||||||
|
|
||||||
|
foreach ($fp as $line) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user