-
Notifications
You must be signed in to change notification settings - Fork 1
/
taskadd.php
54 lines (45 loc) · 1.19 KB
/
taskadd.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
require("needlogin.php");
require("mysql.php");
if(!$_POST['taskname'])
{
header("Location: newtask.php?msg=必须填写任务名称");
die();
}
if(!$_POST['taskurl'])
{
header("Location: newtask.php?msg=必须填写任务URL");
die();
}
if(!stristr($_POST['taskurl'],"http://"))
{
$_POST['taskurl']="http://".$_POST['taskurl'];
}
if($_POST['method']!="POST" && $_POST['method']!="GET")
{
header("Location: newtask.php?msg=请求方式必须为GET或POST");
die();
}
if(intval($_POST['proxynum'])<=0)
{
header("Location: newtask.php?msg=代理数量必须是大于0的一个整数");
die();
}
$times=intval($_POST['hour'])*3600+intval($_POST['minunte'])*60+intval($_POST['second']);
if($times<=0)
{
header("Location: newtask.php?msg=任务时间要大于等于1秒");
die();
}
easymysql_insert("task", array(
"name"=>$_POST['taskname'],
"url"=>$_POST['taskurl'],
"method"=>$_POST['method'],
"data"=>$_POST['postdata'],
"proxy"=>intval($_POST['proxynum']),
"time"=>intval($_POST['hour'])."小时".intval($_POST['minunte'])."分钟".intval($_POST['second'])."秒",
"addtime"=>time(),
"cookie"=>$_POST['cookies'],
"endtime"=>time()+$times
));
header("Location: task.php");