av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

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

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

瀏覽:2日期:2024-01-07 08:21:35
現在我們來講一下reply.php的代碼: --------------------------------- //reply.php <? ;;function check_strlen_long($txt) { $len=strlen($txt); $count=0; 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>=60);;;;{ ;;$txt[$i]="n";$count=0; ;;} } ;;return $txt; } function encode ($txt) { $txt=strip_tags($txt); $txt=htmlspecialchars($txt); $message=StripSlashes($txt); return $message; } ;;$content=file("guest.txt"); ;;$disptext=$content[$record-1]; ;;; if ($job=="addreply" and $replyname!="" and $replycontent!="") { $content=file("guest.txt"); $count=count($content); $time = date(Y年m月d日H小時i分); $ip=$REMOTE_ADDR; $replycontent=StripSlashes($replycontent); $replyname=encode($replyname); $replycontent=htmlspecialchars($replycontent); ;;$replycontent=check_strlen_long($replycontent); $replycontent=nl2br($replycontent); $replycontent=ereg_replace(chr(10),"",$replycontent); $content[$record-1]=substr($content[$record-1],0,strlen($content[$i])-1); $content[$record-1]=$content[$record-1]."<!--reply><tr><td colspan=4><ul><font color=#AB00E1>回復內容:</font><br>".$replycontent."<br>回復人大名:".$replyname."<br><font color=#CC33FF>時間:$time 來自:$ip</font></ul><hr size=1 color=blue></td></tr>n" $fp=fopen("guest.txt","w"); for ($i=0;$i<$count;$i++) ;;{ ;;;fputs($fp,$content[$i],strlen($content[$i])); ;;} ;;echo "<meta http-equiv=Refresh content=1;url=guest.php>";exit; } ;;?>;;<title>zihanonline</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: 10p} TH {FONT-SIZE: 10pt} TD {FONT-SIZE: 10pt} --> </style> <body bgcolor="#FFFFFF" background="back.gif"> <div align=center > ;;<? include('head.htm');?> ;;<table border= 1;;width= 65%;;height= 169 cellpadding="8" cellspacing="0" bordercolor="#E3E3E3" > ;;;;<form method= POST;;action=reply.php > ;;;;;;<? ;;;;;;if ($Submit) ;;;;;;;{ if ($replyname=="" or $replycontent=="") { ;;;;;;echo"<tr align=left valign=middle bgcolor=#F0F0F0> ";;;;;echo"<td width= 100%;;height= 31 > ";;;;;echo "<font color=red>出錯了</font>回復人姓名和回復內容必填!";;;;;echo"</td>";;;;;echo"</tr>";;;;;;} ;;;;;;;} ;;;;;;?> ;;;;;;<? echo $disptext ?>;;;;;;;;<tr align="left" valign="middle" bgcolor="#F0F0F0">;;<td width= 100%;;height= 31 bgcolor="#FFFFFF" > 回復大名;;;;<input type= text;;name= replyname;;size= 20 > </td> ;;;;;;</tr> ;;;;;;<tr valign="middle">;;<td width= 100%;;height= 26;;align= left bgcolor="#f0f0f0" >;;;;<p>回復內容</p> ;;</td> ;;;;;;</tr> ;;;;;;<tr align="center">;;<td width= 100%;;height= 52;;valign= top bgcolor="#FFFFFF" >;;;;<textarea rows= 6;;name= replycontent;;cols= 46 wrap="VIRTUAL" ></textarea> </td> ;;;;;;</tr> ;;;;;;<tr valign="middle" align="center" bgcolor="#F0F0F0">;;<td width= 100%;;height= 14 bgcolor="#f0f0f0" >;;;;<input type=hidden name=job value=addreply> ;;<input type=hidden name=record value=<? echo $record ?>> ;;<input type= submit;;value= 提交;;name=Submit > ;;&nbsp;&nbsp;&nbsp;;;;;<input type=reset value= 重寫;;name= B2 > </td> ;;;;;;</tr> ;;;;</form> ;;;;</table>;;;;;;;<?include('bottom.htm');?></div> </body> </html> ------------------ 到此為止,php的代碼我們已經寫完,剩下的是您要作一個留言本的本頭和底部 您可以設計任何的樣式.不過記得在本頭上面要有至少3個連接:查看 返回主頁;;發郵件.這樣您的留言本系統才算完整.不過由于這是一文本的留言本,所以您不用擔心數據庫的問題,您只要再寫一個guest.txt的文件就完整了.雖然這個留言本沒有mysql等等,可是功能仍然不錯.而且是完全屬于您自己的留言本.好了,下一節我們將為您講述guest.txt的建立和上傳留言本的幾個重要步驟. 未完待續...
標簽: PHP
主站蜘蛛池模板: 久久久久久免费精品一区二区三区 | 免费久久网 | 欧美a免费 | 五月天国产 | 日韩喷潮 | 久久中文字幕一区 | 精品国产乱码久久久久久1区2区 | 精品91视频 | 久久久亚洲精品视频 | 天天夜夜操 | 综合久 | 国产一区91精品张津瑜 | 国产第一区二区 | 亚洲第一视频网站 | 日本精品一区 | 国内精品久久影院 | 精品在线一区 | 99久久久久久久久 | 国产精品一区二区久久久久 | 成年人的视频免费观看 | 亚洲久草 | 好姑娘影视在线观看高清 | 狠狠躁夜夜躁人人爽天天高潮 | 中文字幕97| 精品色 | 成人精品一区二区 | 久久精品视频在线观看 | 精品成人av | 欧美一区二区另类 | 亚洲国产成人精品女人久久久野战 | 99精品久久久国产一区二区三 | 91在线精品视频 | 91在线网站 | 国产成人免费视频网站视频社区 | 国产精品7777777 | 色精品视频 | 亚洲视频精品在线 | 日韩在线一区二区三区 | 日韩视频在线免费观看 | 中文字幕第三页 | aaaaaaa片毛片免费观看 |