$title = $_POST['title']; $content = $_POST['content']; $isEnable = isset($_POST['isEnable']) ? 1 : 0; $db->modifyCrawlSettings($id, $name, $startURL, $alloweddomain, $link, $next, $title, $content, $isEnable); // echo "1"; } else { if ($type == "add") { $name = $_POST['name']; $startURL = $_POST['startURL']; $alloweddomain = $_POST['alloweddomain']; $link = $_POST['link']; $next = $_POST['next']; $title = $_POST['title']; $content = $_POST['content']; $isEnable = isset($_POST['isEnable']) ? 1 : 0; $db->addRule($name, $startURL, $alloweddomain, $link, $next, $title, $content, $isEnable); } else { if ($type == "fileupload") { if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { if (true) { $path = $_FILES["file"]["tmp_name"]; $fp = fopen($path, "r") or die("Unable to open file!"); while (!feof($fp)) { $text = fgets($fp); //读取文件的一行 $arr = explode(" ", $text); $name = $arr[0]; $startURL = $arr[1]; $alloweddomain = $arr[2];