Location: PHPKode > projects > Nail Streaming Server > nailss_v12/security/block.php
<?php
session_start();
include_once( getcwd()."/../includes/configuration.php" );
include_once( getcwd()."/../includes/misc.php" );
include_once( getcwd()."/../includes/login.php" );
include_once( getcwd()."/../layout/header.php" );

if($backend != "mysql")
{
	die("MySQL Backend required");
}

connect_to($dbhost, $dbuser, $dbpass, $dbname);

if(isset($_POST["ip"]))
{
	$sql0 = "INSERT INTO `ACL` (`IP`, `Control`) VALUES ('".$_POST["ip"]."', 'deny')";
	$insertResult0 = mysql_query($sql0);
}

$sql1 = "SELECT * FROM `ACL` WHERE `Control` = 'deny'";
$selectResult1 = mysql_query($sql1);

echo( "<table border=\"0\" cellpadding=\"0\" cellspacing=\"5\" width=\"100%\">
<tr><td>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr class=\"tableheader\"><td colspan=\"4\"><center><h3>Denied IP Addresses</h3></center></td></tr>" );

while($row = mysql_fetch_array($selectResult1))
{
	echo( "<tr class=\"hovertr\"><td colspan=\"3\">".$row["IP"]."</td><td><a href=\"drop.php?id=".$row["ID"]."\">Delete</a></tr>" ); 
}

echo( "</table>
</td></tr>
</table><p>&nbsp;</p>" );
echo( "<form action=\"block.php\" method=\"post\">
Add: <input name=\"ip\"><br>
<input type=\"Button\" value=\"Check\" onclick=\"javascript:this.value='Please Wait';this.disabled=1;document.forms[0].submit()\">
</form>" );
?>
Return current item: Nail Streaming Server