Location: PHPKode > scripts > Form Mail Lite > form/spam.php
<?php
require("header.php");
?>
<?php
if(!$_POST["edit"]){
$Log=file("log/ip.cgi");
$line=explode(",",$Log[0]);
$ip=$line[0];
$text=$line[1];
$ip=str_replace("<br />","\n",$ip);
$text=str_replace("<br />","\n",$text);
}
?>
<?php
if($_POST["edit"]){
if($_POST['ip'] != '') {
$dumpip = (mb_strlen($_POST['ip'], 'SJIS'));
if (10000 < $dumpip) {
$preview1 .= 'Please enter Prohibited IP that is less than or equal to 10000 characters.<br>';
$flag = 1;
}
}
if($_POST['text'] != '') {
$dumptext = (mb_strlen($_POST['text'], 'SJIS'));
if (10000 < $dumptext) {
$preview1 .= 'Please enter Prohibited words that is less than or equal to 10000 characters.<br>';
$flag = 1;
}
}
$err = '';
if($preview1 != '') {
$err .= $preview1;
$flag = 1;
}
}
?>
<?php
if($_POST["edit"]){
$ip=$_POST["ip"];
$text=$_POST["text"]; 
}
?>
<?php
if (!$flag){
if($_POST["edit"]){
$ip = strip_tags($ip);
$ip = ereg_replace("\n$", "", $ip);
$ip = ereg_replace("\r$", "", $ip);
$text = strip_tags($text);
$text = ereg_replace("\n$", "", $text);
$text = ereg_replace("\r$", "", $text);
$ip=nl2br($ip);
$ip=str_replace("\n","",$ip);
$ip=str_replace("\r","",$ip);
$text=nl2br($text);
$text=str_replace("\n","",$text);
$text=str_replace("\r","",$text);
$ip=str_replace(",","",$ip);
$text=str_replace(",","",$text);
$lines=array("$ip","$text","1");
$lines=implode(",",$lines);
$lines=$lines."\n";
$fp=fopen("log/ip.cgi","w");
flock($fp, LOCK_EX);
fputs ($fp, $lines);
fclose($fp); 
$ip=str_replace("<br />","\n",$ip);
$text=str_replace("<br />","\n",$text);
print "Saved<br><br>";
}
}
?>
Spam settings<br><br>
<?php
if ($flag){
?>
<?=$err?>
<?php
}
?>
<table width='400' border='0' cellspacing='1' bgcolor='#BBBBBB'>
<form action="" method="POST">
<tr><td align='left' bgcolor='#ffffff' width='35%'><SMALL>&nbsp;<b>Prohibited IP</b></SMALL></td><td bgcolor='#ffffff'>
<textarea name="ip" rows ="40" cols="33" style="height:3em;margin-bottom:1px;overflow:visible;ime-mode:disabled;"><?=$ip?></textarea>
</td></tr>
<tr><td align='text' bgcolor='#ffffff' width='35%'><SMALL>&nbsp;<b>Prohibited words</b></SMALL></td><td bgcolor='#ffffff'>
<textarea name="text" rows ="40" cols="33" style="height:3em;margin-bottom:1px;overflow:visible;"><?=$text?></textarea>
</td></tr>
</table>
Prohibited words are words, email address, URL, etc.<br>
Use line break for each word.<br>
Examples of rohibit words<br>
Prohibited words<br>
Prohibited email address
<table width='400'>
<tr><td align='center'><br><div class="submit"><input type="submit" name="edit" value=" Update "></div></form></td></tr>
</table>
<?php
require("footer.php");
?>
Return current item: Form Mail Lite