September 20, 2017

自分のブログをIPでブロックする方法

自分のサイトにいたずらをする人がいる
自分のサイトを会社の人にみられたくない

などなど

そんな時にご利用くださいw

<script language="Javascript" src="https://www.l2.io/ip.js?var=UserIP"></script>
<script language="Javascript">
function preloadFunc()
{
var ip = UserIP;
var bannedips=[
"xx.xx.xxx.xxx.",
"xx.xx.xxx.xxx."
]
var handleips=bannedips.join("|")
handleips=new RegExp(handleips, "i")
if (ip.search(handleips)!=-1){
window.location.replace("http://google.com");
document.write('<!--');
}
}
window.onpaint = preloadFunc();
</script>





aya_welcom at 07:29│Comments(0)clip!コーディング。 

この記事にコメントする

名前:
URL:
  情報を記憶: 評価: 顔   
 
 
 
Recent Comments
プロフィール

あや。@ロス
出身地:鹿児島
生息地:カリフォルニア
続きを見る >>