require "include/bittorrent.php"; dbconn(); loggedinorreturn(); if (get_user_class() < UC_MODERATOR) stderr( _("Error"), _("Permission denied.")); if ($_SERVER["REQUEST_METHOD"] == "POST") $ip = $_POST["ip"]; else $ip = $_GET["ip"]; if ($ip) { $nip = ip2long($ip); if ( ($nip == -1) || ($nip === false) ) stderr( _("Error"), "Bad IP."); $sql = sprintf('SELECT * FROM bans WHERE %u >= first AND %u <= last', $nip, $nip); $res = do_mysql_query($sql) or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($res) == 0) stderr("Result", "The IP address $ip is not banned."); else { $banstable = "
First | Last | Comment |
$first | $last | $comment |
The IP address $ip is banned: |
$banstable
"); } } stdhead(); ?>