亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

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

瀏覽:3日期:2024-01-07 08:21:35
現(xiàn)在我們來講一下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小時(shí)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>回復(fù)內(nèi)容:</font><br>".$replycontent."<br>回復(fù)人大名:".$replyname."<br><font color=#CC33FF>時(shí)間:$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>出錯(cuò)了</font>回復(fù)人姓名和回復(fù)內(nèi)容必填!";;;;;echo"</td>";;;;;echo"</tr>";;;;;;} ;;;;;;;} ;;;;;;?> ;;;;;;<? echo $disptext ?>;;;;;;;;<tr align="left" valign="middle" bgcolor="#F0F0F0">;;<td width= 100%;;height= 31 bgcolor="#FFFFFF" > 回復(fù)大名;;;;<input type= text;;name= replyname;;size= 20 > </td> ;;;;;;</tr> ;;;;;;<tr valign="middle">;;<td width= 100%;;height= 26;;align= left bgcolor="#f0f0f0" >;;;;<p>回復(fù)內(nèi)容</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的代碼我們已經(jīng)寫完,剩下的是您要作一個(gè)留言本的本頭和底部 您可以設(shè)計(jì)任何的樣式.不過記得在本頭上面要有至少3個(gè)連接:查看 返回主頁;;發(fā)郵件.這樣您的留言本系統(tǒng)才算完整.不過由于這是一文本的留言本,所以您不用擔(dān)心數(shù)據(jù)庫的問題,您只要再寫一個(gè)guest.txt的文件就完整了.雖然這個(gè)留言本沒有mysql等等,可是功能仍然不錯(cuò).而且是完全屬于您自己的留言本.好了,下一節(jié)我們將為您講述guest.txt的建立和上傳留言本的幾個(gè)重要步驟. 未完待續(xù)...
標(biāo)簽: PHP
主站蜘蛛池模板: 黄色片免费在线 | 亚洲香蕉在线观看 | 在线视频一二三区2021不卡 | 99在线国内精品自产拍 | 国产午夜免费视频片夜色 | 视频一区二区免费 | 欧美性综合| 毛片免费观看网址 | 欧美精品v国产精品v日韩精品 | 伊人久久综合视频 | 免费视频一级片 | 91色在线观看国产 | 三级视频在线播放线观看 | 又粗又硬的aaaaaaa毛片 | 日本人视频18jizz免费 | 97一区二区三区四区久久 | 日韩毛片高清免费 | 成人做爰全过程免费看网站 | 久久国产中文字幕 | 成人免费在线视频观看 | 精品久久久在线观看 | 国产精品福利视频手机免费观看 | 美国黄色片免费看 | 99久久精彩视频 | 国产精品亚洲欧美大片在线看 | 亚洲精品欧美精品一区二区 | 亚洲国产成人精品青青草原100 | 噜噜噜福利视频在线观看 | 青草久久精品亚洲综合专区 | 91av综合| 免费一级做a爰片性视频 | 欧美日韩在线观看一区 | 成人午夜免费视频免费看 | 99免费精品视频 | 国产乱码一区二区三区四 | 亚洲欧美不卡 | 国内精品视频免费观看 | 亚洲精品自产拍在线观看 | 亚洲人成网站在线播放观看 | 麻豆精品国产免费观看 | 1024亚洲视频|