★三 【 スクリプト改造工房 PART 8 】 ★三at PHP
★三 【 スクリプト改造工房 PART 8 】 ★三 - 暇つぶし2ch629:nobodyさん
05/02/12 14:58:20
cgiにこういうのを入れて、リストにあるIPを弾いています。
これを逆にリストにあるIPだけ許可できるように改造できないでしょうか?
お願いします。

&hostcheck;
sub hostcheck{
local($host_file,$remote_host,$line);
local(@lines);
$host_file = './host.dat';
$host=$ENV{'REMOTE_HOST'};
open(DB,"$host_file") || die "Cannot Open Log File $host_file: $!";
@lines = <DB>;
close(DB);
foreach $line (@lines) {
next if(length($line)<4);
chop $line;
if( $host=~/$line/ ){print "Status: 204\n\n";exit;}
}
}#hostcheck END


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch