Location: PHPKode > projects > Free Blog Creator > freeblog/config2.php
<?php
require("header.php");
?>
Menu &gt; Spam settings<br><br><br>
<?php
if(!$_POST["edit"]){

$Log=@file("./log/basic2.cgi");
$line=explode(",",$Log[0]);
$delivfree=$line[0];
$delivmail=$line[1];
$commentname=$line[2];
$commentemail=$line[3];
$commentlink=$line[4];
$commenttext=$line[5];
$tblink=$line[6];
$ip=$line[7];
$text=$line[8];


$ip=str_replace("<br />","\n",$ip);
$text=str_replace("<br />","\n",$text);

}
?>

<?php
if($_POST["edit"]){

if($_POST["delivfree"]==1){
if($_POST['delivmail'] == '') {
$preview1 .= 'Please enter Email.<br>';
$flag = 1;
}
}
if($_POST['delivmail']) {
if (!preg_match('/^[a-zA-Z0-9_\.\-]+?@[A-Za-z0-9_\.\-]+$/',$_POST['delivmail'])) {
$preview1 .= 'Email seems invalid.<br>';
$flag = 1;
}
}
if($_POST['ip'] != '') {
$dumpip = (mb_strlen($_POST['ip'], 'UTF-8'));
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'], 'UTF-8'));
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"]){
$delivfree=$_POST["delivfree"];
$delivmail=$_POST["delivmail"];
$commentname=$_POST["commentname"];
$commentemail=$_POST["commentemail"];
$commentlink=$_POST["commentlink"];
$commenttext=$_POST["commenttext"];
$tblink=$_POST["tblink"];
$ip=$_POST["ip"];
$text=$_POST["text"];
}
?>

<?php
if (!$flag){
if($_POST["edit"]){
$ip = strip_tags($ip);
$ip = preg_replace("/[\n\r]$/","", $ip);
$text = strip_tags($text);
$text = preg_replace("/[\n\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);

$lines=array("$delivfree","$delivmail","$commentname","$commentemail","$commentlink","$commenttext","$tblink","$ip","$text","1");
$lines=implode(",",$lines);
$lines=$lines."\n";

$fp=fopen("./log/basic2.cgi","w");
fputs($fp,$lines);	
fclose($fp);


$ip=str_replace("<br />","\n",$ip);
$text=str_replace("<br />","\n",$text);


print "Saved<br><br>";
}
}
?>


<?php
if ($flag){
?>
<?=$err?>
<?php
}
?>
<table width='450' border='0' cellspacing='1' bgcolor='#BBBBBB'>
<form action="" method="POST">
<tr><td align='left' bgcolor='#ffffff' width='30%'>&nbsp;<b>E-mail notification</b></td><td bgcolor='#ffffff'>
<select name="delivfree">
<?php
if(($delivfree==1) || ($delivfree=='')){
$delivfreeSelected1="selected";
}
else{
$delivfreeSelected0="selected";
}
?>
<option value="1" <?=$delivfreeSelected1?>>Notify</option>
<option value="0" <?=$delivfreeSelected0?>>Not notified</option>
</select>
</td></tr>
<tr><td align='left' bgcolor='#ffffff' width='30%'>&nbsp;<b>Notification e-mail</b></td><td bgcolor='#ffffff'><input size='30' type='text' name='delivmail' value='<?=$delivmail?>'></input></td></tr>


<tr><td align='left' bgcolor='#ffffff' width='35%'><SMALL>&nbsp;<b>Comment: Name</b></SMALL></td><td bgcolor='#ffffff'>
<select name="commentname">
<?php
if(($commentname==1) || ($commentname=='')){
$commentnameSelected1="selected";
}
else{
$commentnameSelected0="selected";
}
?>
<option value="1" <?=$commentnameSelected1?>>Input Required</option>
<option value="0" <?=$commentnameSelected0?>>Permission not entered</option>
</select>
</td></tr>
<tr><td align='left' bgcolor='#ffffff' width='35%'><SMALL>&nbsp;<b>Comment: Email</b></SMALL></td><td bgcolor='#ffffff'>
<select name="commentemail">
<?php
if(($commentemail==1) || ($commentemail=='')){
$commentemailSelected1="selected";
}
else{
$commentemailSelected0="selected";
}
?>
<option value="1" <?=$commentemailSelected1?>>Input Required</option>
<option value="0" <?=$commentemailSelected0?>>Permission not entered</option>
</select>
</td></tr>
<tr><td align='left' bgcolor='#ffffff' width='35%'><SMALL>&nbsp;<b>Comment: URL</b></SMALL></td><td bgcolor='#ffffff'>
<select name="commentlink">
<?php
if(($commentlink==1) || ($commentlink=='')){
$commentlinkSelected1="selected";
}
else{
$commentlinkSelected0="selected";
}
?>
<option value="1" <?=$commentlinkSelected1?>>Input Required</option>
<option value="0" <?=$commentlinkSelected0?>>Permission not entered</option>
</select>
</td></tr>
<tr><td align='left' bgcolor='#ffffff' width='35%'><SMALL>&nbsp;<b>Comment: Content</b></SMALL></td><td bgcolor='#ffffff'>
<select name="commenttext">
<?php
if(($commenttext==1) || ($commenttext=='')){
$commenttextSelected1="selected";
}
else{
$commenttextSelected0="selected";
}
?>
<option value="1" <?=$commenttextSelected1?>>Input Required</option>
<option value="0" <?=$commenttextSelected0?>>Permission not entered</option>
</select>
</td></tr>
<tr><td align='left' bgcolor='#ffffff' width='35%'><SMALL>&nbsp;<b>Accept trackback with no related link?</b></SMALL></td><td bgcolor='#ffffff'>
<select name="tblink">
<?php
if(($tblink==1) || ($tblink=='')){
$tblinkSelected1="selected";
}
else{
$tblinkSelected0="selected";
}
?>
<option value="1" <?=$tblinkSelected1?>>Not accept</option>
<option value="0" <?=$tblinkSelected0?>>Accept</option>
</select>
</td></tr>
<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="38" 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="38" 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='450'>
<tr><td align='center'><br><div class="submit"><input type="submit" name="edit" value="Save"></div></form></td></tr>
</table>






<?php
require("footer.php");
?>
Return current item: Free Blog Creator