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

<head>
<title>刪除留言</title>
<style>
<!--
A:link {text-decoration: none ; color:0000ff}
A:visited {text-decoration: none; col " /> 一级毛片aa,日韩成人在线免费视频,欧美国产亚洲18

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

一個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作的文本留言本的例子(四),轉載需保留來源!

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

主站蜘蛛池模板: 中文字幕日本精品一区二区三区 | 色播99| 国内精品在线视频 | 国产一二三区视频 | 色综合综合在线 | 成人免费观看黄a大片夜月 成人免费观看视频 | 5252色欧美在线男人的天堂 | 久久婷婷五色综合夜啪 | 亚洲伊人久久大香线蕉苏妲己 | 亚洲图片激情 | 国产精品免费观看视频播放 | 美女视频一区二区 | 婷婷亚洲久悠悠色在线播放 | 国产福利视精品永久免费 | 一级毛片成人免费看免费不卡 | 成人午夜性视频欧美成人 | 亚洲性色成人 | caoporn人人| 五月婷婷中文字幕 | 欧美日韩国产亚洲一区二区 | 99在线视频观看 | 婷婷99视频精品全部在线观看 | 久久亭亭 | 国产l精品国产亚洲区久久 国产swag在线 | 99免费在线观看视频 | 天天舔天天操 | 一级爱做片免费观看久久 | 4hc44www四虎永久 | 国产在线观看一区二区三区 | 四虎影视国产在线观看精品 | 精品亚洲一区二区三区 | 国产女人综合久久精品视 | 国产成人短视频 | 久久99热国产这有精品 | 亚洲另类激情小说 | 五月婷婷丁香网 | 夜色资源站www国产在线资源 | 久久夜色精品国产噜噜亚洲a | 99爱在线视频这里只有精品 | 国产精品欧美在线不卡 | 乱码一区二区三区完整视频 |