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

<head>
<title>刪除留言</title>
<style>
<!--
A:link {text-decoration: none ; color:0000ff}
A:visited {text-decoration: none; col " /> 亚州日韩精品AV片无码中文,99久久亚洲综合精品,男总裁憋尿PLAY灌尿BL

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

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

這一節(jié)我們將dele.php和sys.php放上來(lái).
---------
//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>密碼錯(cuò)誤</font>.無(wú)權(quán)操作..";}

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 "僅刪除回復(fù)";
     }
     ?>
        <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="我要?jiǎng)h除了">
      </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' "一欄中等號(hào)后的是留言本的管理密碼號(hào),此時(shí)是默認(rèn)的zihanonline.您可以修改為自己的號(hào)碼.
未完待續(xù)...

php技術(shù)一個(gè)php作的文本留言本的例子(四),轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 国产偷抇久久精品A片蜜臀A | 亚洲中文久久久久久国产精品 | 榴莲推广APP网站入口下载安装 | 恋老视频 国产国佬 | 92看看福利午夜影院 | 国产色婷婷亚洲99麻豆 | 美女脱18以下禁止看免费 | 老师在讲桌下边h边讲课 | 亚洲AV无码国产精品色午夜情 | 免费毛片网站在线观看 | 性一交一无一伦一精一品 | 午夜男人免费福利视频 | 日本一本免费线观看视频 | 色偷偷91综合久久噜噜 | 国内精品久久久久久久试看 | YELLOW在线观看高清视频免费 | 伊人久久大香线蕉影院95 | 5G年龄确认我已满18免费 | 日韩精品亚洲专区在线电影不卡 | 99久久久久精品国产免费麻豆 | 99久久麻豆AV色婷婷综合 | 国精产品一区一区三区有限公司 | 小sao货水好多真紧h的视频 | 69丰满少妇AV无码区 | 亚洲熟女乱色一区二区三区 | 国产精品久久久久一区二区三区 | 人人艹人人 | 99国产精品欲AV蜜桃臀麻豆 | 久久精品国产亚洲AV久五月天 | 精品AV国产一区二区三区 | 2022国产91精品久久久久久 | 极品少妇伦理一区二区 | 菠萝视频高清版在线观看 | 九九视频在线观看视频6 | 动漫美女被爆挤奶歪歪漫画 | 激情床戏视频片段有叫声 | 年轻的女职工在线观看 | 波多野结衣 无码片 | 肉欲横流(NP高H) | 国产高清在线露脸一区 | 久久视频这有精品63在线国产 |