---------
//dele.php<html>

<head>
<title>刪除留言</title>
<style>
<!--
A:link {text-decoration: none ; color:0000ff}
A:visited {text-decoration: none; col " /> 色老板影视,色拍拍噜噜噜久久蜜桃,麻豆一二三四区乱码

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

一個php作的文本留言本的例子(四)

這一節我們將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.您可以修改為自己的號碼.
未完待續...

php技術一個php作的文本留言本的例子(四),轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 免费观看美女的网站 | 毛片手机在线观看 | 受被三个攻各种道具PLAY | 偷窥美女3| 亚洲毛片网 | 久久久国产精品免费A片蜜芽广 | 伊人久久大香线蕉综合电影网 | 无套暴躁白丝秘书 | 国产不卡在线观看视频 | 国产精品一区二区亚瑟不卡 | 囯产免费久久久久久国产免费 | 青青在线视版在线播放 | 秋霞电影伦网理最新在线看片 | 黑色丝袜在线观看 | 台湾佬综合娱乐网 | 亚洲精品无码国产爽快A片 亚洲精品无码成人AAA片 | 免费观看a视频 | 她也色在线视频站 | 成人在线观看视频免费 | 91天堂国产在线 在线播放 | 99E久热只有精品8在线直播 | 国产精品嫩草影视在线观看 | 亚洲美女视频高清在线看 | 欧美精品色婷婷五月综合 | 欧美激情视频一区 | 直插下身完整的欧美版 | 寂寞护士中文字幕 mp4 | 涩涩在线视频 | 受被三个攻各种道具PLAY | 亚洲欧洲日产国码久在线 | 国产精品久久久久久久人热 | 色噜噜噜噜亚洲第一 | 云南14学生真实初次破初视频 | 秋葵app秋葵官网18在线观看 | 色综合久久中文色婷婷 | 亚洲VA欧美VA天堂V国产综合 | 中文字幕精品无码一区二区 | 国产欧美一区二区精品仙草咪 | 67194成网页发布在线观看 | 日夜啪啪一区二区三区 | 99视频在线国产 |