Advertisement
Guest User

ipv6

a guest
Apr 20th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. if ($_SERVER["REQUEST_METHOD"] == "POST"){
  2. $first = trim($_POST["first"]);
  3. $last = trim($_POST["last"]);
  4. $comment = htmlsafechars(trim($_POST["comment"]));
  5. if (!$first || !$last || !$comment){
  6. stderr("{$lang['stderr_error']}", "{$lang['text_missing']}");
  7. }
  8. $first = ip2long($first);
  9. $last = ip2long($last);
  10. if ($first == - 1 || $first === FALSE || $last == - 1 || $last === FALSE){
  11. stderr("{$lang['stderr_error']}", "{$lang['text_badip.']}");
  12. }
  13. $added = TIME_NOW;
  14. for ($i = $first; $i <= $last; $i++) {
  15. $key = 'bans:::' . long2ip($i);
  16. $mc1->delete_value($key);
  17. }
  18. mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO bans (added, addedby, first, last, comment) VALUES($added, " . sqlesc($CURUSER['id']) . ", " . sqlesc($first) . ", " . sqlesc($last) . ", " . sqlesc($comment) . ")") or sqlerr(__FILE__, __LINE__);
  19. die;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement