您的位置:首页网页设计PHP实例 → 支持oicq头像的留言簿二

支持oicq头像的留言簿二

时间:2004/11/7 3:25:00来源:本站整理作者:蓝点我要评论(0)

addnote.php







添加留言









    

    

    

  

医学导航网   

      


    



include ("config.php");

if ($submit){

$time=date("Y年m月d日 H:i:s A");

$ip=$REMOTE_ADDR;//留言人ip地址

$name=trim($name);

$email=trim($email);

$title=strip_tags($top);

$nnote=nl2br(strip_tags($content));//先去掉html标记,再将换行符转成


if (!$name||!$email||!$title||!$nnote){           //检查是否填写完整

      echo "对不起,您必须填所有内容!
"."返回";

      exit; }elseif(!ereg('^[-!#$%&'*+./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+.'.'[-!#$%&'*+\./0-9=?A-Z^_`a-z{|}~]+$',$email)  //email合法性验证

       ){

       echo "email不合法!
"."返回";

       exit;

             }

   //写入数据库

$sql="INSERT INTO notebook (name,email,time,face,ip,title,nnote) VALUES ('$name','$email','$time','$face','$ip','$title','$nnote')";

$result = mysql_query($sql,$db);

mysql_close($db);

echo "留言成功!";

}

?>



    

    

    

  

    

    

  

首页  

      > 留言簿  

      > 添加留言
查看留言  

    


      


        

            

            

            

          

            

            

          

            

            

          

        
  选择一个自己喜欢的头像:


                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

                

              

            
名字 

              

              


              Email  

              

              


              标题  

              

              


              内容


              

            
  

              


                

                

              


            


              


    





  







delnote.php


include ("config.php");

if ($superadmin){      //如果已经进行管理员登陆,进行密码验证

if (!($user==$username)||!($psw==$password)){  

echo "密码错误";

exit;

}

}else{              //管理员登陆

echo "
";

echo "
请输入管理员密码
";

echo "管理员";  

echo "
";

echo "密码";

echo "
";

echo "
";

echo "
";   

echo "
";

exit;

}

if($del==1){       //判断是否要删除

mysql_query("delete from notebook where time='$time'",$db); //以留言时间为删除标志

echo "删除成功!";

}

?>







删除留言








$result = mysql_query("SELECT * FROM notebook ",$db);

$row=mysql_num_rows($result);//查看结果有多少行

$max=$row; //帖子总数

//设每页显示10篇,$p总页数,$page第几页,$low 从第几行开始读,$x 读取几行

if (!$page){$page=1;}

$p=ceil($max/10);

$low=10*($page-1);

if($page==$p&&($max%10)<>0){$x=($max%10);} else {$x=10;}//如果是最后一页,且不是10的整倍数,读取$max除以10的余数,否则取10

if($max==0){$x=0;}//如果没有帖子,$x取0

$result = mysql_query("select * from notebook ORDER BY time DESC limit $low,$x",$db);

?>



    

    

    

  

医学导航网   

      


    




    

    





      

          

          

          

          

        

      
首页  

            &gt; 留言簿
  

            
          echo "帖子总数: &nbsp;",$max," &nbsp;&nbsp;第";

          for ($n=1;$n<=$p;$n++){

          echo "$n&nbsp;";

          }

          echo "页";

          ?>

          
查看留言
  


   for ($i=0;$i<=($x-1);$i++) {

   $email=mysql_result($result,$i,'email');

   $face=mysql_result($result,$i,'face');

   $face='image/face/icon'.$face;

   $name=mysql_result($result,$i,'name');

   $time=mysql_result($result,$i,'time');

   $ip=mysql_result($result,$i,'ip');

   $title=mysql_result($result,$i,'title');

   $nnote=mysql_result($result,$i,'nnote');

echo "";  

echo "";

echo        "";

echo        "";

echo        "";

echo        "  ";  

echo        "";

echo        "
&nbsp;留言人:$name发表于:$time &nbsp;$ip
标题:$title
留言内容:$nnote
";

}

mysql_close($db);

?>     

    







相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 我的php文件怎么打开_php运算符怎么写 php 如何生成静态页面的函数PHP生成图片缩略图PHP session常见问题集锦及解决办法PHP实现同步远程Mysql

人气排行 DEDE在文章列表文章没有缩略图的不显示图片php+mysq修改用户密码我的php文件怎么打开_如何打开php文件的办法FCKeditor的配置和使用方法使用dedecms建站教程PHP+Ajax实现分页技术图片存储与浏览一例Linux+Apache+PHP+MySQLPHP生成图片缩略图