[Release] WebBan Script + Java + MSSQL

AgMuN4o

Banned
Joined
Apr 19, 2008
Messages
106
Reaction score
53
Hello there this is my project of a web ban script

SQL Tables
Code:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Banned_IP]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Banned_IP]
GO

CREATE TABLE [dbo].[Banned_IP] (
	[IP] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[reason] [varchar] (999) COLLATE Chinese_PRC_CI_AS NULL ,
	[from] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

Create new file block-IP.php or of your choice and put this code
Code:
<?php
$ip = $_SERVER['REMOTE_ADDR'];                                                                           
$dbuser = "sa";                                                                                    
$dbpasswd = "123456789";
$host = "127.0.0.1";                                                     
$db = 'MuOnline';
mssql_connect("$host","$dbuser","$dbpasswd");
mssql_select_db("$db");
$q = mssql_query("SELECT * FROM Banned_IP WHERE IP = '$ip'");
$get = mssql_num_rows($q);
// if found
if ($get == "1")
{ 
// deny user access
$r=mssql_fetch_array($q);
echo('<script language="Javascript">alert("YOUR IP '.$_SERVER["REMOTE_ADDR"].' BLOCKED \n Reason: '.$r["reason"].'\n By '.$r["from"].'"); </script>');
exit();
}
?>

Recommended
Update II - 12.02.2009 added Account Ban
Create new file block-IP.php or of your choice and put this code

Code:
mssql_connect("$host","$dbuser","$dbpasswd");
mssql_select_db("$db");
$q = mssql_query("SELECT * FROM Banned_IP WHERE IP = '$ip'");
$get = mssql_num_rows($q);
$q2 = mssql_query("SELECT * FROM MEMB_INFO WHERE bloc_code = '1'");
$get2 = mssql_num_rows($q2);
$r=mssql_fetch_array($q);
$r2=mssql_fetch_array($q2);
// if found
if ($get == "1" && $get2 == "1")
{
echo('<script language="Javascript">alert("YOUR Account '.$r2["memb___id"].' \nYOUR IP '.$_SERVER["REMOTE_ADDR"].'\nBLOCKED \nReason: '.$r["reason"].'\nBy '.$r["from"].'"); </script>');
exit();
}
elseif ($get == "1")
{ 
// deny user access
echo('<script language="Javascript">alert("YOUR IP '.$_SERVER["REMOTE_ADDR"].' BLOCKED \nReason: '.$r["reason"].'\nBy '.$r["from"].'"); </script>');
exit();
}
elseif ($get2 == "1")
{
echo('<script language="Javascript">alert("YOUR Account '.$r2["memb___id"].' BLOCKED \n"); </script>');
exit();
}

in your config.php make new line and put this code
include('block-IP.php');


Created by AgMuN4o

Use Тhanks Botton
 
Last edited:
Ей ман извинявай за ламерския вапрос обаче тва каде се пише ?!?!?!??!?!?
 
можеш да го модифицираш да блоква акаунт или ип (2-3 вида блокиране), че доста хора не ползват реални ип-та все още и като натегнеш някой бан на някой интернет доставик става кофти
 
можеш да го модифицираш да блоква акаунт или ип (2-3 вида блокиране), че доста хора не ползват реални ип-та все още и като натегнеш някой бан на някой интернет доставик става кофти

Оригиналният код на това е мое дело :p
 
  • Like
Reactions: vesichaa
Добрече си учил малко JavaScript в даскало, иначе изобщо нямаше да има JavaScript в кода :;)::]:)::yes:
 
Update II - 12.02.2009 added Account Ban
Read my first post