atari Posted August 19, 2005 Report Share Posted August 19, 2005 Veelos kaadu piemeeru skriptam, kas kontroleetu apmekleetaaju IP adreses, ideja taada, ja apmekleetaajs naak uz saitu ar kaadu noteiktu IP adresi vai no IP adreshu grupas, kas ir ierakstiita skriptaa, tad skripts izsauc kaadu konkreetu failu (piem.: forbidden.php). Paldies! Link to comment Share on other sites More sharing options...
Analgiins Posted August 19, 2005 Report Share Posted August 19, 2005 $juuzera_ip = $_SERVER["REMOTE_ADDR"]; $sliktaas_ip = Array(<kaut kaads masiivs ar sliktajaam IP>); if (in_array($juuzera_ip, $sliktaas_ip)) { include_once('forbidden.php'); } else { include_once('not_forbidden.php'); } Link to comment Share on other sites More sharing options...
Robis Posted August 19, 2005 Report Share Posted August 19, 2005 $user_ip = $_SERVER['REMOTE_ADDR']; $forbidden_ips = array('82.345.678.900', '...', '...', ...); if (in_array($user_ip, $forbidden_ips)) die ("FUCK OFF!"); Link to comment Share on other sites More sharing options...
bubu Posted August 19, 2005 Report Share Posted August 19, 2005 Robi, kāda jēga atkārtoties? Link to comment Share on other sites More sharing options...
Robis Posted August 19, 2005 Report Share Posted August 19, 2005 Ne gluži atkārtojos. Nedaudz atšķiras kodi. Link to comment Share on other sites More sharing options...
bubu Posted August 19, 2005 Report Share Posted August 19, 2005 Nu atšķirība aloritma ziņā ir nekāda. Pie tam tavā kodā nedara to, ko prasīja cilvēks - neiekļauj citu php skriptu. Link to comment Share on other sites More sharing options...
Robis Posted August 19, 2005 Report Share Posted August 19, 2005 Nez vai ir jēga pārspriezt tādu sīkumus. Jautājums ir tik elementārs, ka visi tur var likt savus piepušķojumus un variantus kā to izdarīt... Link to comment Share on other sites More sharing options...
v3rb0 Posted August 19, 2005 Report Share Posted August 19, 2005 Robi, kāda jēga atkārtoties? 21244[/snapback] dubults neplist! :rolleyes: Link to comment Share on other sites More sharing options...
bra Posted August 22, 2005 Report Share Posted August 22, 2005 oki man iepatikās doma par IP apgabala noteikšanu kā nez ar php to varētu izdarīt? Link to comment Share on other sites More sharing options...
bubu Posted August 22, 2005 Report Share Posted August 22, 2005 if ($a<=$ip && $ip<=b) { echo "$ip ir starp $a un $b ieskaitot"; } Link to comment Share on other sites More sharing options...
Recommended Posts