Example #1
0
<?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");
Example #2
0
while ($i < count($strarr)) {
    $res = explode(":", $strarr[$i]);
    if (strval(intval($res[1])) != $res[1]) {
        $fail++;
    } else {
        if ($res[0] . ":" . intval($res[1]) != $strarr[$i]) {
            $fail++;
        } else {
            if (intval($res[1]) > 65535 || intval($res[1]) < 1) {
                $fail++;
            } else {
                $checkresult = easymysql_select('proxy', array("ip" => $res[0]));
                if ($checkresult["ip"] == $res[0]) {
                    $readded++;
                } else {
                    easymysql_insert('proxy', array("ip" => $res[0], "port" => $res[1], "status" => 3, "checked" => "None", "taskid" => 0));
                    $success++;
                }
            }
        }
    }
    $i++;
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">