作者:tanglei52017 | 来源:互联网 | 2018-04-22 05:42
这一节我们将dele.php和sys.php放上来.---------dele.php<html><head><title>删除留言<title><style><!--A:link{text-decoration:none;color:0000
这一节我们将dele.php和sys.php放上来.
---------
//dele.php
require("sys.php");
if ($Submit)
{
if ($passWord<>$managepwd)
{$errorm="
密码错误.无权操作..";}
else
{
$cOntent=file($guestfile);
$message=$content[$record-1];
$count=count($content);
if ($dele=="delreply")
{
$replylen=strlen(strstr($message,""));
$lOng=strlen($message);
$len=$long-$replylen;
$message=substr($message,0,$len);
}
else
{$message="";}
//writefile
$fp=fopen($guestfile,"w");
for ($i=0;$i<$count;$i++)
{
if ($i==($record-1)){$content[$i]=$message;}
fputs($fp,$content[$i],strlen($content[$i]));
}//end for
fclose($fp);
echo "";
exit;
}
}// end ifSubmit
$cOntent=file($guestfile);
$message=$content[$record-1];
$found=ereg("",$message);
?>
include("head.htm"); ?>
include("bottom.htm"); ?>
------
//sys.php
$managepwd='zihanonline';
$guestfile="guest.txt";
function check_strlen_long($txt)
{
$count=0;
$arrtemp=$txt;
$len=strlen($txt);
$txt=$txt.' ';
for ($i=0;$i<$len;$i++)
{
if (ord($txt[$i])<128)
{ $count=$count+1;}
if (ord($txt[$i])==10 or ord($txt[$i])==32)
{$count=0;}
if ($count>=70)
{
for ($j=$i;$j<$len;$j++)
{
$txt[$j+1]=$arrtemp[$j];
}
$txt[$i]="n";
$len=$len+1;
$txt[$len]=$arrtemp[$len-1];
$count=0;
$arrtemp=$txt;
}//end if count
}
$txt=trim($txt);
return $txt;
}//end function
function encode ($txt)
{
$txt=strip_tags($txt);
$txt=htmlspecialchars($txt);
$message=StripSlashes($txt);
return $message;
}
function ubb($txt)
{
}
?>
----------
注意sys.php中的" $managepwd='zihanonline' "一栏中等号后的是留言本的管理密码号,此时是默认的zihanonline.您可以修改为自己的号码.
未完待续...