<?php //Ban System 0.1//Coded By Doddy H//Datos para la DB$host = "localhost";$userw = "root";$passw = "";$db = "ban";//mysql_connect($host,$userw,$passw);mysql_select_db($db);$ipa = ip2long($_SERVER[REMOTE_ADDR]);$ip = $_SERVER[REMOTE_ADDR];if ($ipa == -1 || $ipa === FALSE) {$re = mysql_query("select ip from bansystem where ip='$ip'");if (mysql_num_rows($re) > 0) {echo "<center><h1>Has sido baneado de esta pagina</h1></center>";} else {echo "<center><h2>Bienvenido</h2></center>";}} else {echo "<script>alert('Muy gracioso');</script>";}mysql_close();// The End ??>
<?php //Ban System Admin 0.1//Coded By Doddy H//Datos para el login$username = "admin";$password = "21232f297a57a5a743894a0e4a801fc3"; //admin////Datos para la DB$host = "localhost";$userw = "root";$passw = "";$db = "ban";//if (isset($_COOKIE['portal'])) {$st = base64_decode($_COOKIE['portal']);$plit = split("@",$st);$user = $plit[0];$pass = $plit[1];if ($user == $username and $pass == $password) {mysql_connect($host,$userw,$passw);mysql_select_db($db);if(isset($_POST['instalar'])) {$todo = "create table bansystem (id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,ip TEXT NOT NULL,PRIMARY KEY(id));";if (mysql_query($todo)) {echo "<script>alert('Instalado correctamente');</script>";echo '<meta http-equiv="refresh" content=0;URL=>';} else {echo "<script>alert('Error');</script>";}}if( mysql_num_rows(mysql_query("show tables like 'bansystem'"))) {//Lo demasecho "<title>BanSystem Administracion</title>";echo "<center><h1>BanSystem Administracion</h1></center><br><br>";if(isset($_POST['ipadd'])) {$ipfinal = ip2long($_POST['ipadd']);$ipaz = $_POST['ipadd'];if ($ipfinal == -1 || $ipfinal === FALSE) {echo "<script>alert('Eso no es una IP');</script>";} else {if (mysql_query("INSERT INTO bansystem (id,ip) values (NULL,'$ipaz')")) {echo "<script>alert('IP Agregada');</script>";} else {echo "<script>alert('Error');</script>";}}}if(isset($_GET['del'])) {$id = $_GET['del'];if (@mysql_query("DELETE FROM bansystem where id ='$id'")) {echo "<script>alert('Borrado');</script>";} else {echo "<script>alert('Error');</script>";}}echo "<center><h2>Agregar una IP</h2><br><br><form action='' method=POST>IP : <input type=text name=ipadd value=127.0.0.1><input type=submit value=Agregar></form><br><br><h2>Baneados</h2><br><br><table border=1><td>ID</td><td>IP</td><td>Option</td><tr>";$sen = @mysql_query("select * from bansystem order by id ASC");while ($ab = @mysql_fetch_array($sen)) {echo "<td>".htmlentities($ab[0])."</td><td>".htmlentities($ab[1])."</td><td><a href=?del=".htmlentities($ab[0]).">Delete</a></td><tr>";}echo "</table></center>";//} else {echo "<center><br><br><form action='' method=POST><h2>Deseas instalar Ban System ?</h2><br><br><input type=submit name=instalar value=Instalar></form>";}mysql_close();exit(1);// End} else {echo "<script>alert('Segui Participando');</script>";}}if (isset($_POST['login'])) {if ($_POST['user'] == $username and md5($_POST['password']) == $password) {setcookie("portal",base64_encode($_POST['user']."@".md5($_POST['password']))); echo "<script>alert('Bienvenido idiota');</script>";echo '<meta http-equiv="refresh" content=0;URL=>';} else {echo "<script>alert('Segui Participando');</script>";}} else {echo "<title>Ban System</title><h1><center>Ban System</center></h1><br><br><center><form action='' method=POST>Username : <input type=text name=user><br>Password : <input type=text name=password><br><br><input type=submit name=login value=Enter><br></form></center><br><br>";}// The End ??>