diff options
Diffstat (limited to 'pool_save.php')
-rw-r--r-- | pool_save.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pool_save.php b/pool_save.php new file mode 100644 index 0000000..5d67a25 --- /dev/null +++ b/pool_save.php @@ -0,0 +1,25 @@ +<?php + +if (!$_GET['session'] || !$_GET['name']) { + echo "empty"; + return; +} + +$f = fopen(tempnam("../tmp", "assignment-"), "wa"); + +fwrite($f,urldecode($_GET["name"])."\n"); +fwrite($f,urldecode($_GET["session"])."\n"); +fwrite($f,getdate()[0]."\n"); +fclose($f); + +$checkf = "../tmp/".urldecode($_GET["session"]); +if (file_exists($checkf)) { + echo "notok"; +} else { + $g = fopen($checkf, "wa"); + fwrite($g, "x\n"); + fclose($g); + echo "ok"; +} + +?> |