Erin Clock (g1r1) | 2009-11-30 08:56 |
IL configuration deleter (g1r1) | 2009-11-30 09:08 |
Shaman Japanese Language Pack (g3r1) | 2009-11-30 09:17 |
Simple P2P Messenger (Jasmine) (g3r6) | 2009-11-30 09:21 |
This document describes how to implement proxy blocker via 2ch vandal denying service by using PHP.
Before I build up this website, I was an administrator of a certain game fan website.
However, I couldn't administrate it because of my administrative ability. By its lack, of cource, vandalisms were occured.
In order to stop them, I implemented this mod.
The implementation code is here:
- <?php
- function isPxy($addr){
- $bbq_deny=implode('.',array_reverse(explode('.', $user->ip)));
- $bbq_return=gethostbyname("$bbq_deny.niku.2ch.net");
- $bbx_return=gethostbyname("$bbq_deny.bbx.2ch.net");
- $return_datas=array("127.0.0.2","127.0.0.3","127.0.0.4");
- return (gethostbyaddr($user->ip) ===$user->ip||array_search($bbq_return,$return_datas)!==FALSE||array_search($bbx_return,$return_datas)!==FALSE);
- }
- ?>
When you use that code, you can write like the following:
- <?php
- //implemantation code
- function isPxy($addr){
- $bbq_deny=implode('.',array_reverse(explode('.', $user->ip)));
- $bbq_return=gethostbyname("$bbq_deny.niku.2ch.net");
- $bbx_return=gethostbyname("$bbq_deny.bbx.2ch.net");
- $return_datas=array("127.0.0.2","127.0.0.3","127.0.0.4");
- return (gethostbyaddr($user->ip) ===$user->ip||array_search($bbq_return,$return_datas)!==FALSE||array_search($bbx_return,$return_datas)!==FALSE);
- }
- //check proxy.There is an IPaddress in $ipaddress
- if(isPxy($ipaddress)){
- //Write code when $ipaddress is proxy
- }else{
- //write elese.
- }
- ?>
[PageInfo]
LastUpdate: 2011-08-20 22:05:01, ModifiedBy: green_12512
[License]
GNU Free Documentation License
[Permissions]
view:all, edit:login users, delete/config:members