init
This commit is contained in:
commit
ee3a64e0f6
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
data/
|
36
index.php
Normal file
36
index.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
$idcko = $_GET['id'];
|
||||
|
||||
if (!empty($idcko)){
|
||||
|
||||
$ipcka = $_SERVER['REMOTE_ADDR'];
|
||||
$stranky = json_decode(file_get_contents("data/pageindex.json"), true);
|
||||
$alllog = "data/all.log";
|
||||
$pagepath = "data/pages/";
|
||||
|
||||
if(array_key_exists($idcko, $stranky)){
|
||||
|
||||
$entry = $stranky[$idcko];
|
||||
$logfile = $pagepath . $entry["logfile"];
|
||||
$contentfile = $pagepath . $entry["contentfile"];
|
||||
$nickname = $entry["nickname"];
|
||||
$logmessage = "Success from $nickname(\"$idcko\"), IP: $ipcka\n";
|
||||
|
||||
file_put_contents($logfile, $logmessage, FILE_APPEND);
|
||||
file_put_contents($alllog, $logmessage, FILE_APPEND);
|
||||
|
||||
echo file_get_contents($contentfile);
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
die("Bad link");
|
||||
file_put_contents($pagepath . $entry["logfile"], "Fail from \"$idcko\", IP: $ipcka\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
else{
|
||||
die("Bad link");
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user