其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
PHP简单留言本的制作(五)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

留言在数据库的保存:(数据库的修改)

<?
      function err_output($errstr="未知错误!")
      {
          echo "<div align='center'>
<TABLE cellSpacing=0 cellPadding=0 width='70%' align=center border=0>
  <tbody>
  <tr><td>输入有误!<b>$errstr</b><br><br>请点击这里<a href=javascript:history.go(-1);>返回</a></td></tr>
  </tbody>
</TABLE>
</div><br><br><br><DIV id=bottom>
</DIV>";
          exit();
      }
      $db=mysql_connect("localhost","huqingsql","000000")
             or err_output("无法连数据库!");
      mysql_select_db("huqingsql")
             or err_output("无法选择数据库!");
      //用户点击添加按钮
      if($add)
      {
          //合法性检验
          if(empty($name)||empty($title)||empty($message))
          {
              err_output("姓名/标题/留言内容不能为空!");
          }
      $face="<img height=100 width=100 src=images/".$face." border=0>";
   $posttime=date("Y-m-d G:i:s");
      mysql_query("insert into guestbook values(0000,'$name','$title','$posttime','$weather','$message','$face','$smile')")
                 or die(mysql_error());
?>


相关文章

相关软件