<?php
// Ban System 0.3
// (C) Doddy Hackman 2015
// Login
$username = "admin"; // Edit
$password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
// DB
$host = "localhost"; // Edit
$userw = "root"; // Edit
$passw = ""; // Edit
$db = "ban"; // Edit
if (isset($_COOKIE['login'])) {
$user = $plit[0];
$pass = $plit[1];
if ($user == $username and $pass == $password) {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ban System 0.3</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="images/icono.png">
</head>
<body>
<center>';
echo ' <br><img src="images/ban.png" /><br><br>';
if (isset($_POST['instalar'])) {
$todo = "create table ban_system (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
ip TEXT NOT NULL,
PRIMARY KEY(id));
";
echo "<script>alert('Installed');</script>";
echo '<meta http-equiv="refresh" content=0;URL=>';
} else {
echo "<script>alert('Error');</script>";
}
}
echo "<title>Ban System 0.3 Administracion</title>";
if (isset($_POST['ipadd'])) {
$ipfinal = ip2long($_POST['ipadd']); $ipaz = $_POST['ipadd'];
if ($ipfinal == -1 || $ipfinal === FALSE) {
echo "<script>alert('IP invalid');</script>";
} else {
if (mysql_query("INSERT INTO ban_system (id,ip) values (NULL,'$ipaz')")) { echo "<script>alert('IP added');</script>";
} else {
echo "<script>alert('Error');</script>";
}
}
}
if (isset($_GET['del'])) { $id = $_GET['del'];
if (@mysql_query("DELETE FROM ban_system where id ='$id'")) { echo "<script>alert('IP Deleted');</script>";
} else {
echo "<script>alert('Error');</script>";
}
}
echo '
<div class="post">
<h3>Add IP</h3>
<div class="post_body">';
echo "<br>
<form action='' method=POST>
<b>IP : </b><input type=text name=ipadd value=127.0.0.1> <input type=submit style='width: 100px;' value=Add>
</form><br>";
echo ' </div>
</div>';
$sql = "select id from ban_system";
echo '
<div class="post">
<div class="post_body"><br>';
if ($cantidad <= 0) {
echo '<b>No entries found</b><br>';
} else {
echo '<table>
<td><b>ID</b></td><td><b>IP</b></td><td><b>Option</b></td><tr>';
$sen = @mysql_query("select * from ban_system order by id ASC");
}
echo '</table>';
}
echo ' <br></div>
</div>';
echo "</table>
</center>
";
//
} else {
echo '
<div class="post">
<h3>Installer</h3>
<div class="post_body">';
echo "
<form action='' method=POST>
<h2>Do you want install Ban System ?</h2><br>
<input type=submit style='width: 100px;' name=instalar value=Install><br><br>
</form>";
echo ' </div>
</div>';
}
echo '
<br><h3>(C) Doddy Hackman 2015</h3><br>
</center>
</body>
</html>';
} else {
echo "<script>alert('Fuck You');</script>";
}
} else {
echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
}
?>