Jump to content
php.lv forumi

bloķēt valsts ip


ziedinjsh

Recommended Posts

googlē es skatījos, bet tur es atradu kodus ar array. dabuju ip adrešu sarakstu, bet nevaru izdomāt kā viņu dabūt iekš datubāzēs ( deny from 31.201.1.140 - 31.201.1.143 ) jo to visu pārakstīt būtu neprāts!

 

Nē, nekādu porno čatu! :D

Link to comment
Share on other sites

Doooh!

 

Kāpēc gan tu nevarētu darīt šādi?

 

$tons_of_addresses = explode("\n", file_get_contents('tons_of_addresses.txt'));

if (in_array($user_ip, $tons_of_addresses)) {

   throw new Exception('Fuck off!');

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...