| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> php >> PHP+TEXT留言本(一) PHP+TEXT liu yan ben ( yi )
 

PHP+TEXT留言本(一)

2008-12-28 07:39:49 编辑來源:互联网 繁體版 评论
 
 
本文为【PHP+TEXT留言本(一)】的汉字拼音对照版显示拼音
  dajiazhidao,shujukuduiyuwangluolaishuodechongyaoxing.youyucgidefuduo,xianzaiasphephp+mysqlyijingchengweizhuliu.jihusuoyoudegerenwangyedouyaoyongdaoliuyanben,keshishenqingdeliuyanbenhenbuwending.zheweiwangshangdejiaoliudailailezhuduobu便bian.suoyi,xiwangyongyouzijideliuyanbendepengyouyuelaiyueduo.

  danshi,mianfeidegerenzhuyezhichiasphephpdehenshao.bizhexianzaixiangnintuijiandongzhanzhinan,(http://www.knowsky.com)zhichiphp.zheyangnin便bianyoulenenggouyongyouzijiliuyanbendejichu.xianzai,wojiutongguoyigewenbenliuyanbendelizilaijiangshuphpdejiandan使shiyong.

   shouxian,womenxianqueding,liuyandejigeguocheng:xieliuyan,fasong,chakan.(sousuo)dengdeng.erqieduiyubanzhulaishuo,guanliliuyanbenyoushibukehuoquede.zheyangwomenjiubufangdingweiyu6gephpwenjian,1gewenbenwenjian.6gephpwenjianfenbiewei:guest.php manage.php reply.php sys.php del.php edit.php,1gewenbenwenjianwei:guest.txt

  xianlaikankanguest.phpdeneirong,nidangrankeyizhijiejiangxiamiandeneirongfangdaonindephpwangyeli,qingzunchongzuozhedelaodong,xiexie.

  ----------------------

  //guest.php:<?

  require("sys.php");

  if ($B1)

  {

   if ($message=="" or $name=="")

   {

   $errorm="<font color=red>chucuole!!!</font>xingmingheliuyanneirongbitian";

   }

   else

  {

  #xierushuju

  $space = " ";

  $time = date(YnianmyuedriHxiaoshiifen);

  $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 = "<tr><td><font color=#AB00E1>liuyanneirong:</font><br><!--content>$message<!--endcontent> ";

  $guestcontent=$guestcontent."<br><font color=#6633FF>liuyanrendaming:</font><!--name>$name<!--endname> ";

  if ($email !="")

  {$guestcontent=$guestcontent."<br><font color=#9900CC>dianzixinxiang</font><a href=\"email]$email"."$space'mailto:$email\"><!--email>$email<!--endemail></a>"."$space";}

  if ($homepage !="http://")

  {$guestcontent=$guestcontent."<font color=#9900CC>zhuye:</font>$hompage<a href=\"$homepage\"><!--homepage>$homepage<!--endhomepage></a>";}

  $guestcontent=$guestcontent."<br><font color=#0000FF>shijian:$time laizi:<!--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>

  <title>zihanonlinegbook</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: "songti";

  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>";

   }

   ?>

   <tr>

   <td width="22%" bgcolor="#F0F0F0"><font color="#000000">xingming<font color="#FF0033">(bitian)</font></font></td>

   <td colspan="2" width="78%" bgcolor="#F0F0F0"><font color="#00FF00">

   <input type="text" name="name" size="40">

   </font></td>

   </tr>

   <tr>

   <td width="22%" height="29">zhuye:</td>

   <td colspan="2" height="29" width="78%">

   <input type="text" name="homepage" size="40" value="http://">

   </td>

   </tr>

   <tr>

   <td width="22%" height="27" bgcolor="#F0F0F0">laizi:</td>

   <td colspan="2" height="27" width="78%" bgcolor="#F0F0F0">

   <input type="text" name="from" size="40">

   </td>

   </tr>

   <tr>

   <td width="22%" height="20">Email:</td>

   <td colspan="2" height="20" width="78%"><font color="#00FF00">

   <input type="text" name="email" size="40">

   </font></td>

   </tr>

   <tr>

   <td colspan="3" valign="middle" align="left">

   <div align="center"><font color="#000000">qingliuyan</font><font color="#FF0033">(bitian)</font><font color="#00FF00"><br>

   <textarea rows="6" name="message" cols="55" wrap="VIRTUAL"></textarea>

   </font></div>

   </td>

   </tr>

   <tr bgcolor="#F0F0F0">

   <td colspan="3" height="24">

   <div align="center"><font color="#00FF00">

   <input type="submit" value="fa song" name="B1">

      

   <input type="reset" value="chong xie" name="B2">

   </font></div>

   </td>

   </tr>

   </form>

   </table>

   <table width="68%" border="1" cellpadding="4" cellspacing="0" bordercolor="#E3E3E3">

   <tr>

   <td>

   <table width="100%" border="0" cellpadding="0" cellspacing="0">

   <form action=manage.php method=post>

   <tr>

   <td colspan="2">

   <input type=hidden name=dispflag value=show>

   guanlimima:

   <input type=password name=password size=8>

    

   <input type=submit value="que ding" name="submit">

   </td>

   </tr>

   </form>

   </table>

   </td>

   <td>

   <table width="100%" border="0" cellpadding="0" cellspacing="0">

   <form action=guest.php method=post>

   <tr>

   <td> qingshuruguanjianzi:

   <input type="text" name="keyword" size="10">

   <input type="submit" name="search" value="sousuoliuyan">

   </td>

   </tr>

   </form>

   </table>

   </td>

   </tr>

   </table>

   <?

   function search($keyword)

   {

   global $content;

   $count=count($content);

   $subscript=0;

   $ArrSearch=array();

   for ($i=0;$i<$count;$i++)

   {

   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;//zongtiaoshu;

   $int_page_num=ceil($int_page_count/$one_page_line);//zongyeshu;

   echo "<font color=#CC33FF>fenye:";

   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!="")

   {

   echo "<br><center>";

   echo "xiamiandeliuyanzhongbaohanguanjianzi<font color=red>$keyword</font>gong<font color=red>".$count."</font>tiao</center>";

   }

   ?>

   </td><td><p align=right>gongyou<font color=red><?echo "$count"?></font>tiao</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."<tr><td align=right colspan=2><a href=reply.php?job=reply&record=".$j.">huifu</a> <a href=edit.php?record=".$j.">bianji</a> <a href=dele.php?record=".$j.">shanchu</a> di<font color=red>$j</font>tiao</td></tr>";

   $text.=$content[$j-1];

  

   //shuzuzhaoxiabiaocong0kaishi.

   }

  

  echo "$text";

  ?>

  </table>

  <?

  include('bottom.htm');

  ?>

  </body>

  </html>

  ------------------

  weiwandaixu...原文】【拼音
 
 
 
 
上一篇《操作Oracle的php类》
下一篇《PHP+TEXT留言本(二)》
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
大家知道,数据库对于网络来说的重要性.由于cgi的复杂,现在asp和php+mysql已经成为主流.几乎所有的个人网页都要用到留言本,可是申请的留言本很不稳定.这为网上的交流带来了诸多不便.所以,希望拥有自己的留言本的朋友越来越多. 但是,免费的个人主页支持asp和php的很少.笔者现在向您推荐动站指南,([url=http://www.knowsky.com]http://www.knowsky.com[/url])支持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.php"); if ($B1) { if ($message=="" or $name=="") { $errorm="<font color=red>出错了!!!</font>姓名和留言内容必填"; } else { #写入数据 $space = "&nbsp;"; $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 = "<tr><td><font color=#AB00E1>留言内容:</font><br><!--content>$message<!--endcontent> "; $guestcontent=$guestcontent."<br><font color=#6633FF>留言人大名:</font><!--name>$name<!--endname> "; if ($email !="") {$guestcontent=$guestcontent."<br><font color=#9900CC>电子信箱</font><a href=\"[url=mailto:$email\]$email[/url]"."$space'mailto:$email\"><!--email>$email<!--endemail></a>"."$space";} if ($homepage !="http://") {$guestcontent=$guestcontent."<font color=#9900CC>主页:</font>$hompage<a href=\"$homepage\"><!--homepage>$homepage<!--endhomepage></a>";} $guestcontent=$guestcontent."<br><font 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> <title>zihanonlinegbook</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">&nbsp; <? 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>"; } ?> <tr> <td width="22%" bgcolor="#F0F0F0"><font color="#000000">姓名<font color="#FF0033">(必填)</font></font></td> <td colspan="2" width="78%" bgcolor="#F0F0F0"><font color="#00FF00"> <input type="text" name="name" size="40"> </font></td> </tr> <tr> <td width="22%" height="29">主页:</td> <td colspan="2" height="29" width="78%"> <input type="text" name="homepage" size="40" value="http://"> </td> </tr> <tr> <td width="22%" height="27" bgcolor="#F0F0F0">来自:</td> <td colspan="2" height="27" width="78%" bgcolor="#F0F0F0"> <input type="text" name="from" size="40"> </td> </tr> <tr> <td width="22%" height="20">Email:</td> <td colspan="2" height="20" width="78%"><font color="#00FF00"> <input type="text" name="email" size="40"> </font></td> </tr> <tr> <td colspan="3" valign="middle" align="left"> <div align="center"><font color="#000000">请留言</font><font color="#FF0033">(必填)</font><font color="#00FF00"><br> <textarea rows="6" name="message" cols="55" wrap="VIRTUAL"></textarea> </font></div> </td> </tr> <tr bgcolor="#F0F0F0"> <td colspan="3" height="24"> <div align="center"><font color="#00FF00"> <input type="submit" value="发 送" name="B1"> &nbsp;&nbsp;&nbsp; <input type="reset" value="重 写" name="B2"> </font></div> </td> </tr> </form> </table> <table width="68%" border="1" cellpadding="4" cellspacing="0" bordercolor="#E3E3E3"> <tr> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <form action=manage.php method=post> <tr> <td colspan="2"> <input type=hidden name=dispflag value=show> 管理密码: <input type=password name=password size=8> &nbsp; <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> <tr> <td> 请输入关键字: <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(); for ($i=0;$i<$count;$i++) { 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>&nbsp;"; } echo "</font>"; if (isset($search) and isset($keyword) and $keyword!="") { echo "<br><center>"; echo "下面的留言中包含关键字<font color=red>$keyword</font>共<font color=red>".$count."</font>条</center>"; } ?> </td><td><p 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."<tr><td align=right colspan=2><a href=reply.php?job=reply&record=".$j.">回复</a>&nbsp;<a href=edit.php?record=".$j.">编辑</a>&nbsp;<a href=dele.php?record=".$j.">删除</a>&nbsp;第<font color=red>$j</font>条</td></tr>"; $text.=$content[$j-1]; //数组找下标从0开始. } echo "$text"; ?> </table> <? include('bottom.htm'); ?> </body> </html> ------------------ 未完待续...
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚秀气模特裴裴(8)
时尚秀气模特裴裴(7)
时尚秀气模特裴裴(6)
时尚秀气模特裴裴(5)
白墙黑瓦
广州东郊[原创]
八美至丹巴的东谷天然盆景
不一样的
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有