当前位置:澳门新葡亰登入 > 澳门新葡亰平台游戏 > 澳门新葡亰平台游戏先来看看guest.php的内容

澳门新葡亰平台游戏先来看看guest.php的内容

文章作者:澳门新葡亰平台游戏 上传时间:2020-05-08

大家知晓,数据库对于网络来讲的要害性.由于cgi的繁杂,以后asp和php+mysql已经产生主流.大致具备的村办网页都要用到留言本,可是申请的留言本特不牢固.那为英特网的调换带给了好些个不便.所以,希望保有和谐的留言本的心上人尤为多. 但是,无需付费的个人主页扶植asp和php的超级少.小编今后向你推荐奥索网,(State of Qatar扶植php.那样您便有了能够具有谐和留言本的基本功.现在,作者就经过二个文件留言本的例子来说述php的简短利用. 首先,大家先分明,留言的多少个进程:写留言,发送,查看.(寻觅卡塔尔(قطر‎等等.并且对于斑竹来讲,管理留言本又是少不了的.那样大家就无妨定坐落于6个php文件,1个文件文件.6个php文件分别为:guest.php manage.php reply.php sys.php del.php edit.php,1个公文文件为:guest.txt 先来探视guest.php的内容,你当然能够一向将上面包车型客车剧情放到您的php网页里,请爱惜笔者的辛苦,多谢. ---------------------- //guest.php:? require(sys.phpState of Qatar; if ($B1State of Qatar { if($message== or $name==卡塔尔(قطر‎ { $errorm=font color=red出错了!!!/font姓名和留言内容必填; } else { #写入数据 $space = ; $time = date(Y年m月d日H小时i分卡塔尔国; $ip=$REMOTE_ADDR; $name=encode($name); $homepage=encode($homepage); $from=encode($from); $email=encode($email); $message=StripSlashes($message); $message=htmlspecialchars($message); $message=check_strlen_long($message); $message=nl2br($message); $guestcontent = trtdfont color=#AB00E1留言内容:/fontbr!--content$message!--endcontent ; $guestcontent=$guestcontent.brfont color=#6633FF留言人大名:/font!--name$name!--endname ; if ($email !=) {$guestcontent=$guestcontent.brfont color=#9900CC电子信箱/fonta href=/mailto:$email/!--email$email!--endemail/a.$space;} if ($homepage !=) {$guestcontent=$guestcontent.font color=#9900CC主页:/font$hompagea href=/$homepage/!--homepage$homepage!--endhomepage/a;} $guestcontent=$guestcontent.brfont color=#0000FF时间:$time 来自:!--from$from!--endfrom $ip/font; $guestcontent=ereg_replace(chr(10),,$guestcontent); $guestcontent=$guestcontent.hr size=1/td/tr/n; $fp=fopen($guestfile,a); fputs($fp,$guestcontent); fclose($fp); } } ? html head titlezihanonlinegbook/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} TEXTAREA { FONT-FAMILY: 宋体; FONT-SIZE: 10pt; } -- /style body bgcolor=#FFFFFD background=bg.jpg div align=center? include('head.htm');? table width=68% border=1 cellpadding=3 cellspacing=0 bordercolor=#E3E3E3 form method=POST action=guest.php ? if ($errorm) { echo tr; echo td colspan=3 height=32 ; echo $errorm; echo /td; echo /tr; } ?trtd width=22% bgcolor=#F0F0F0font color=#000000姓名font color=#FF0033(必填)/font/font/td td colspan=2 width=78% bgcolor=#F0F0F0font color=#00FF00input type=text name=name size=40 /font/td /tr trtd width=22% height=29主页:/td td colspan=2 height=29 width=78%input type=text name=homepage size=40 value= /td /tr trtd width=22% height=27 bgcolor=#F0F0F0来自:/td td colspan=2 height=27 width=78% bgcolor=#F0F0F0input type=text name=from size=40 /td /tr trtd width=22% height=20Email:/td td colspan=2 height=20 width=78%font color=#00FF00input type=text name=email size=40 /font/td /tr trtd colspan=3 valign=middle align=leftdiv align=centerfont color=#000000请留言/fontfont color=#FF0033(必填)/fontfont color=#00FF00br textarea rows=6 name=message cols=55 wrap=VIRTUAL/textarea /font/div /td /tr tr bgcolor=#F0F0F0td colspan=3 height=24div align=centerfont color=#00FF00input type=submit value=发送 name=B1 input type=reset value=重 写 name=B2 /font/div /td /tr /form /table table width=68% border=1 cellpadding=4 cellspacing=0 bordercolor=#E3E3E3 trtd table width=百分百 border=0 cellpadding=0 cellspacing=0 form action=manage.php method=post trtd colspan=2input type=hidden name=dispflag value=show 管理密码:inputtype=password name=password size=8 input type=submit value=鲜明 name=submit /td /tr /form /table /td td table width=100% border=0 cellpadding=0 cellspacing=0 form action=guest.php method=post trtd 请输加入关贸总协定组织键字:input type=text name=keyword size=10 input type=submit name=search value=寻找留言 /td /tr /form /table /td /tr /table ? function search($keyword卡塔尔国 { global $content; $count=count($content卡塔尔国; $subscript=0; $ArrSearch=array(State of Qatar; for ($i=0;$i$count;$i++State of Qatar { if (ereg($keyword,$content[$i])){ $ArrSearch[$subscript]=ereg_replace($keyword,font color=red$keyword/font,$content[$i]); $subscript++; } } return $ArrSearch; }//end function $one_page_line=15; $content = file($guestfile); if (isset($search) and isset($keyword) and $keyword!=) { $content=search($keyword); } $count =count($content); ? table width=68% border=0 tr td ? $int_page_count=$count;//总条数; $int_page_num=ceil($int_page_count/$one_page_line);//总页数; echo font color=#CC33FF分页:; for ($i=1;$i=$int_page_num;$i++) { echo a href=guest.php?page=$i.$i./a; } echo /font; if (isset($search) and isset($keyword) and $keyword!=State of Qatar { echo brcenter; echo 上边包车型大巴留言中含有关键字font color=red$keyword/font共font color=red.$count./font条/center; } ? /tdtdp align=right共有font color=red?echo $count?/font条/p/td /tr /table /div br table width=68% border=0 align=center ? if ($page== or !isset($page)) {$page=1;} $text=; $begin_line=$int_page_count-($page-1)*$one_page_line; if ($begin_line$one_page_line){$one_page_line=$begin_line;} for ($j=$begin_line;$j($begin_line-$one_page_line);$j--) { $text=$text.trtd align=right colspan=2a href=reply.php?job=reply&record=.$j.回复/aa href=edit.php?record=.$j.编辑/aa href=dele.php?record=.$j.删除/a第font color=red$j/font条/td/tr; $text.=$content[$j-1]; //数组找下标从0带头. } echo $text; ? /table ? include('bottom.htm'卡塔尔国; ? /body/html ------------------ 未完待续...

本文由澳门新葡亰登入发布于澳门新葡亰平台游戏,转载请注明出处:澳门新葡亰平台游戏先来看看guest.php的内容

关键词: