Code: Select all
<?php
$data = mysql_query("SELECT * FROM IP")
or die(mysql_error());
if($_POST['ipSubmit'] == 'Add')
{
if($ip == "")
die("<hr>You must add an ip or host");
if($ipnote == "")
die("<hr>You must add a reason.");
while($bip = mysql_fetch_array( $data ))
{
if($ip == $bip['ip'])
die("<hr>Ip already exsists.");
}
mysql_query("INSERT INTO `IP` VALUES ('$ip', '$ipnote')");
Print "<hr>Ip has been successfully added to the blacklist database.";
}
?>Thanks
Gemster