[ipban.php] lists ip's and posts associated with them.
Code: Select all
<?PHP
session_start();
if($_SESSION['admin'] == "*")
{
include("ips.php");
for($a = 0; $a < count($ip); $a++)
{
echo "IP: <a hr ef='banit.php?ip=" . $ip[$a] . "'>Ban " . $ip[$a] . "</a ><br/><br/>";
for($b = 0; $b < count($com[$ip[$a]]); $b++)
{
echo $com[$ip[$a]][$b] . "<br/>-<br/>";
}
echo "<h r><br/>";
}
} else {
echo "<!DOC TYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
<ht ml><he ad>
<tit le>404 Not Found</ti tle>
</he ad><bo dy>
<h1>Not Found</h1>
<p>The requested URL /ipban.php was not found on this server.</p>
<h r>
<ad dress>Apache Server at fatalh.sytes.net Port 80</add ress>
</bo dy></ht ml>";
}
?>
Code: Select all
<?PHP
$ip = array();
$com = array();
$ip[] = "ip here";
$com['ip'][] = "comment";
Code: Select all
<?PHP
session_start();
if($_SESSION['admin'] == "*")
{
include("ips.php");
$bip = $_GET['ip'];
$bip = explode(".", $bip);
$bip = $bip[0] . "." . $bip[1] . "." . $bip[2];
$open = fopen("banned.php", "a");
$write = "\$bip[] = '$bip';" . chr(10);
fwrite($open, $write);
fclose($open);
header("location: ipban.php");
} else {
echo "<!DO CTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
<ht ml><he ad>
<ti tle>404 Not Found</t itle>
</he ad><bo dy>
<h1>Not Found</h1>
<p>The requested URL /banit.php was not found on this server.</p>
<hr>
<add ress>Apache Server at fatalh.sytes.net Port 80</addr ess>
</b ody></ht ml>";
}
?>
Code: Select all
<?PHP
$bip = array();
$bip[] = '85.255.120'; // f*ckin' spammer
Code: Select all
<?PHP
// die("maintenance.");
session_start();
include("banned.php");
$lip = $_SERVER['REMOTE_ADDR'];
$lip = explode(".", $lip);
$lip = $lip[0] . "." . $lip[1] . "." . $lip[2];
if(array_search($lip, $bip) !== FALSE)
{
die("You've been banned from posting comments, most likely because of extreme stupidity, noobishness, spamming, or refusal to follow my rules. No you're not getting a second chance, unless you can find me. So if your life revolves around reading and posting in my blog, well, go crawl in a corner and die.");
}
if($_POST['verify'] == $_SESSION['num'] and !empty($_POST['name']) and !empty($_POST['comment']) and !empty($_POST['id']))
{
$name = $_POST['name'];
$comment = $_POST['comment'];
$id = $_POST['id'];
$comment = htmlentities($comment);
$name = htmlentities($name);
$comment = str_replace("\'", "'", $comment);
$comment = str_replace(chr(10), "<br/>", $comment);
// $name = str_replace("<", "[", $name);
// $comment = str_replace("<", "[", $comment);
$wri = "\$comment[$id][] = \"<h4>$name</h4> $comment<div class=underline> </div>\";" . chr(10);
include("ips.php");
$open = fopen("ips.php", "a");
if(array_search($lip, $ip) === FALSE)
{
$write = "\$ip[] = '$lip';" . chr(10);
fwrite($open, $write);
}
$write = "\$com['$lip'][] = \"$comment\";" . chr(10);
fwrite($open, $write);
fclose($open);
$open = fopen("comment.php", "a");
fwrite($open, $wri);
fclose($open);
header("location: comments.php?id=$id");
} else {
die("You forgot to do the image verification, or you didn't fill out the whole form.");
}
?>