国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

PHP+TEXT留言本(四)

瀏覽:102日期:2023-12-29 08:28:36

這一節我們將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 border='1' cellpadding='5' 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 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
主站蜘蛛池模板: 青田县| 岳阳市| 大渡口区| 乌拉特中旗| 平原县| 永靖县| 济源市| 望城县| 诸暨市| 洛阳市| 安宁市| 剑阁县| 镇赉县| 辽源市| 吴旗县| 翁源县| 怀柔区| 三台县| 抚松县| 江油市| 巩留县| 仙居县| 邹平县| 花垣县| 同德县| 涞源县| 宁明县| 丹寨县| 拜城县| 稻城县| 曲麻莱县| 神池县| 平利县| 息烽县| 福建省| 都安| 黄陵县| 仪征市| 海晏县| 高州市| 青浦区|