DDR爱好者之家 Design By 杰米
这一节我们将dele.php和sys.php放上来.
---------
//dele.php<html>
<head>
<title>删除留言</title>
<style>
<!--
A:link {text-decoration: none ; color:0000ff}
A:visited {text-decoration: none; color:004080}
A:active {text-decoration: none}
A:hover {text-decoration: underline; color:ff0000}
BODY {FONT-SIZE:10pt}
TH {FONT-SIZE:10 pt}
TD {FONT-SIZE: 10pt}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<?
require("sys.php");
if ($Submit)
{
if ($password<>$managepwd)
{$errorm="<font color=red>密码错误</font>.无权操作..";}
else
{
$content=file($guestfile);
$message=$content[$record-1];
$count=count($content);
if ($dele=="delreply")
{
$replylen=strlen(strstr($message,"<!--reply>"));
$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 "<meta http-equiv=Refresh content="1;url=guest.php">";
exit;
}
}// end ifSubmit
$content=file($guestfile);
$message=$content[$record-1];
$found=ereg("<!--reply>",$message);
?>
<body bgcolor="#FFFFFF" background="back.gif">
<? include("head.htm"); ?>
<table width="68%" border="1" cellpadding="5" align="center" cellspacing="0" bordercolor="#F2F2F2">
<form action=dele.php method=post>
<?
if ($errorm)
{
echo "<tr>";
echo "<td height=27>$errorm</td>";
echo "</tr>";
}
?>
<? echo $message ?>
<tr align="center">
<td height="37" bgcolor="#f0f0f0">
<?
if ($found)
{
echo "<input type=radio name=dele value=delall>";
echo "全部删除 ";
echo "<input type=radio name=dele value=delreply checked>";
echo "仅删除回复";
}
?>
<font color="#000000">管理密码</font>
<input type="password" name="password" size="10">
<input type=hidden name=record value=<? echo "$record";?
<input type="submit" name="Submit" value="我要删除了">
</td>
</tr>
</form>
</table>
<? include("bottom.htm"); ?>
</body>
</html>
------
//sys.php
<title>zihanonline</title><?
$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)
{
}
?>
<body bgcolor="#FFFFFF" background="back.gif">
----------
注意sys.php中的" $managepwd='zihanonline' "一栏中等号后的是留言本的管理密码号,此时是默认的zihanonline.您可以修改为自己的号码.
未完待续...
---------
//dele.php<html>
<head>
<title>删除留言</title>
<style>
<!--
A:link {text-decoration: none ; color:0000ff}
A:visited {text-decoration: none; color:004080}
A:active {text-decoration: none}
A:hover {text-decoration: underline; color:ff0000}
BODY {FONT-SIZE:10pt}
TH {FONT-SIZE:10 pt}
TD {FONT-SIZE: 10pt}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<?
require("sys.php");
if ($Submit)
{
if ($password<>$managepwd)
{$errorm="<font color=red>密码错误</font>.无权操作..";}
else
{
$content=file($guestfile);
$message=$content[$record-1];
$count=count($content);
if ($dele=="delreply")
{
$replylen=strlen(strstr($message,"<!--reply>"));
$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 "<meta http-equiv=Refresh content="1;url=guest.php">";
exit;
}
}// end ifSubmit
$content=file($guestfile);
$message=$content[$record-1];
$found=ereg("<!--reply>",$message);
?>
<body bgcolor="#FFFFFF" background="back.gif">
<? include("head.htm"); ?>
<table width="68%" border="1" cellpadding="5" align="center" cellspacing="0" bordercolor="#F2F2F2">
<form action=dele.php method=post>
<?
if ($errorm)
{
echo "<tr>";
echo "<td height=27>$errorm</td>";
echo "</tr>";
}
?>
<? echo $message ?>
<tr align="center">
<td height="37" bgcolor="#f0f0f0">
<?
if ($found)
{
echo "<input type=radio name=dele value=delall>";
echo "全部删除 ";
echo "<input type=radio name=dele value=delreply checked>";
echo "仅删除回复";
}
?>
<font color="#000000">管理密码</font>
<input type="password" name="password" size="10">
<input type=hidden name=record value=<? echo "$record";?
<input type="submit" name="Submit" value="我要删除了">
</td>
</tr>
</form>
</table>
<? include("bottom.htm"); ?>
</body>
</html>
------
//sys.php
<title>zihanonline</title><?
$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)
{
}
?>
<body bgcolor="#FFFFFF" background="back.gif">
----------
注意sys.php中的" $managepwd='zihanonline' "一栏中等号后的是留言本的管理密码号,此时是默认的zihanonline.您可以修改为自己的号码.
未完待续...
DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米
暂无评论...
更新日志
2024年11月27日
2024年11月27日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]