PHP+TEXT留言本(四) 打印 E-mail
  2008-01-02

这一节我们将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.您可以修改为自己的号码.
未完待续...

发表评论
网友评论
we
作者 访客 于 2008-07-04 11:41:58
精油 
论文发表 
上海翻译公司 
上海翻译 
英语培训 
英语口语 
神经性皮炎 
皮炎 
湿疹 
荨麻疹 
慢性荨麻疹 
藏獒 
液压缸 
油缸 
破碎机 
北京旅游 
北京旅行社 
条码机 
条码打印机 
条形码打印机 
阴茎增大 
伟哥 
发酵罐 
肠炎 
结肠炎 
直肠炎 
慢性肠炎 
慢性结肠炎 
结肠炎的治疗 
溃疡性结肠炎 
慢性结肠炎的治疗 
大豆床上用品 
保健内衣 
羊绒内衣 
大豆纤维面料 
团购礼品 
移民 
热电偶插头 
测温线 
热电阻 
煤气发生炉 
两段式煤气发生炉 
环保节能型煤气发生炉 
硅碳棒 
吸塑机 
纸管机 
无缝管 
合金管 
无缝管 
无缝钢管 
高血压 
产品设计 
无纸记录仪 
红外测温仪 
无纸记录仪 
韩国服装 
韩版服装 
韩国服饰 
丝锥 
挤压丝锥 
非标丝锥 
梯形丝锥 
螺纹环规 
men spa beijing 
men massage beijing 
pearl jewelry 
Beijing Tour 
china Tour 
beijing Tour 
china Tour 
beijing Tour 
China Necklace Wholesale 
China Bracelet Wholesale 
China Ring wholesale 
China gemstone beads wholesale 
China Jewelry Accessories wholesale 
China Semiprecious beads wholesale 
replica handbag 
replica tiffany 
replica watches 
louis vuitton replica 
chanel replica 
gucci replica 
Chinese language 
Chinese learn 
learning Chinese 
learn mandarin 
ecosway 
gasifier 
coal gas 
coal gasification 
pro dj cases 
beijing tour 
beijing tours 
beijing travel 
beijing tours 
china tour 
beijing 
china tours 
china travel 
beijing china 
china beijing 
beijing hotel 
beijing hotels 
China Flights 
carved fireplace 
stone bathtub 
marble fountain 
marble bench 
marble fireplace 
marble sculpture 
marble columns 
marble lions 
marble doorway 
marble gazebo 
marble pillar 
marble fireplace surround 
marble statue 
marble bathtub

发表评论
用户访客
标题
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
评论



下一篇 >