WIP: skipass task
This commit is contained in:
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