= UC_ADMINISTRATOR) { $first = trim($_POST["first"]); $last = trim($_POST["last"]); $comment = trim($_POST["comment"]); if (!$first || !$last || !$comment) stderr("Error", "Missing form data."); $firstlong = ip2long($first); $lastlong = ip2long($last); if ($firstlong == -1 || $lastlong == -1) stderr("Error", "Bad IP address."); $comment = sqlesc($comment); $added = sqlesc(date("Y-m-d H:i:s")); sql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES($added, ".mysql_real_escape_string($CURUSER[id]).", $firstlong, $lastlong, $comment)") or sqlerr(__FILE__, __LINE__); header("Location: $_SERVER[REQUEST_URI]"); die; } //ob_start("ob_gzhandler"); $res = sql_query("SELECT * FROM bans ORDER BY added DESC") or sqlerr(); stdhead("Bans"); print("
Nothing found
\n"); else { print("| Added | First IP | Last IP | ". "By | Comment | Remove |
| ".gettime($arr[added])." | ".long2ip($arr[first])." | ".long2ip($arr[last])." | ". get_username($arr['addedby']) . " | $arr[comment] | Remove |