summaryrefslogtreecommitdiff
path: root/pool_save.php
blob: 5d67a258e1ad8451411355c0222cf18ce0319fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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";
}

?>