-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocreate.php
32 lines (30 loc) · 964 Bytes
/
docreate.php
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
26
27
28
29
30
31
32
<?php
include "function.php";
include "config.php";
function getrandstring($length=16){
$str = null;
$strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
$max = strlen($strPol)-1;
for($i=0;$i<$length;$i++){
$str.=$strPol[rand(0,$max)];//rand($min,$max)生成介于min和max两个数之间的一个随机整数
}
return $str;
}
$key=getrandstring();
$key=time();
//system("copy .\\code\\koishi\\".$_POST['koishi'].".exe .\\runner\\koishi.exe >nul");
//system("copy .\\code\\satori\\".$_POST['satori'].".exe .\\runner\\satori.exe >nul");
//echo "OK";exit(0);
//system(".\\runner\\judge.exe > ./result/$key.txt");
//system(".\\runner\\run.bat $key.txt >nul 2>nul");
$a=$_POST['koishi'];
$b=$_POST['satori'];
if(!isStringLegal($a) || !isStringLegal($b))
{
echo "FUCK YOU";
exit(0);
}
$map=$_POST['map'];
file_put_contents("task.txt","$a $b $key $map\n",FILE_APPEND);
echo "已创建 KEY为".$key;
?>