文章导航PC6首页软件下载单机游戏安卓资源苹果资源

pc软件新闻网络操作系统办公工具编程服务器软件评测

安卓新闻资讯应用教程刷机教程安卓游戏攻略tv资讯深度阅读综合安卓评测

苹果ios资讯苹果手机越狱备份教程美化教程ios软件教程mac教程

单机游戏角色扮演即时战略动作射击棋牌游戏体育竞技模拟经营其它游戏游戏工具

网游cf活动dnf活动lol周免英雄lol礼包

手游最新动态手游评测手游活动新游预告手游问答

您的位置:首页网页设计PHP实例 → PHP+MYSQL的文章管理系统二 

PHP+MYSQL的文章管理系统二 

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

###############index.php######################

<?session_start();

require"./inc/func.php";

mscon();

require "./inc/header.inc";

?>

 







  

    

    

  



      


          

          

          

          

          

        


      



    


          

          

          

          

          



      





  

    

  

&nbsp;





  



    

    

  



    

     全部类别 <? $typ=file("list.txt");  $num=count($typ);  for($i=2;$i<=$num;$i++)  {    echo"$typ[$i]";}        ?>    

     全部内容   文章内容   文章标题   加入时间   

  

  

  





<?

$type=trim($type);

  if($comm)

    {

     $sec="and comm=1";

     $fir="where comm=1";

    }

  if(!empty($type))

    $query="select count(*) from $table where type='$type' $sec";

  else

    $query="select count(*) from $table $fir";

  $res=mysql_db_query("$database",$query);

  if(@mysql_num_rows($res)>0)

    $tot=mysql_fetch_array($res);

  $total=$tot[0];

  $total_page=ceil($total/$pagenum);

  echo "";

  echo "";

  if(empty($page))

    $page=0;

  if(empty($offset))

    $offset=0;

  $offset=$pagenum*$page;

  if(!empty($type))

     $query="select * from $table where type='$type' $sec order by id desc limit $offset,$pagenum";

  else

    $query="select * from $table $fir order by id desc limit $offset,$pagenum";

  $res=mysql_db_query("$database",$query);

  if(@mysql_num_rows($res)>0)

     while($topic=mysql_fetch_array($res))

       {

         if(strlen($topic[title])>40)

          {

            $topic[title]=substr($topic[title],0,40) ;

            $topic[title]=$topic[title].".....";

          }

         if(trim($topic[time])==date(Y年m月d日))

           $topic[time]="$topic[time]";

           echo"

          

          ";

     }

else

   echo " 对不起,本栏 目暂没有任何文章!!!";

echo "

共:".$total."篇".$total_page."页

[$topic[type]]$topic[title]($topic[time])";

        if($topic[comm]==1)

          echo "";

        if($topic[locked]==1)

          echo "";

        echo "
阅读:$topic[hits] 次;评论:$topic[p_num]次

";

  ?>








  

    

    

    






  <?

     $pre=$page-1;

     $next=$page+1;

 if($page>0)

   echo "上一页

";

 else

  echo "上一页

";  ?>
<?if($page<$total_page-1)

   echo "   下一页

";

else echo "   下一页

";?>


跳转到:

        ?page='+document.forms[1].elements[0].value+'&type=';" class="border">            <?    for($i=0;$i<$total_page;$i++)      {       $p=$i+1;       echo "第".$p."页n";       }  ?>          




选择栏目:

        ?type='+document.forms[2].elements[0].value            <? $typ=file("list.txt");  $num=count($typ);  for($i=0;$i<$num;$i++)  {    echo"$typ[$i]";}        ?>          

    


<form method="post" action= ?type=  target="_balnk">




#####################read_article.php#########################

<?

require"./inc/func.php";

if(!$id)

{

  echo"";

   exit();

}

mscon();

$query="select * from $table where id='$id'";

$res=mysql_db_query("$database",$query);

if(!$res)

  {

    echo "this article has been deleted or no this article!!";

    exit();

  }

$data=mysql_fetch_array($res);

add_hits($data[id]);

$pre=$data[id]-1;

$next=$data[id]+1;

?>




<br/><br/> <?   echo> <br/><br/> </?   echo>






" _ue_custom_node_="true">



 





<TABLE borderColor=#339933 cellSpacing=0 borderColorDark=#ffffff

cellPadding=0 align=center borderColorLight=#000000 border=1 width=545>

  

  

    

  

    

    

    

  

  



                                   &nbsp;                                                                                                                                                                               <IMG height=17              src="images/third-close.gif" width=17 align=absMiddle              border=0 name=content_r03_c28>           


                                                <A class=whitetxt              href="read_article.php?id=">                                   <a class=whitetxt              href="read_article.php?id=">                      <IMG              height=16 src="images/mail.gif" width=16>           <A class=redtxt              href="commend.php?id=">推荐给朋友           发表时间:                            阅读次数:                                     &nbsp;                         

    


<?

if($data[locked]<>0)

{

  echo "对不起!本文已经被管理员锁定!";

}

else

  if($data[html]==1)

     highlight_string($data[cont]);

  else

     echo nl2br($data[cont]);

?>

      



<table bordercolor=#339933 cellspacing=0 bordercolordark=#ffffff

cellpadding=0 align=center bordercolorlight=#000000 border=1 width=545>

  



    

  

  

    

  

  

    

  

  

  

  

  

    

  

  



      
发表评论


    




        您的姓名:

        

       &nbsp;&nbsp;您的电子邮件:

        

        仅站长可见:">

        ">

        


        发表评论:

        

        


        


        

          

          

        

        


      
相关评论


    


<?  $query="select * from $ping_tab where p_id='$id' order by time desc";

  $res=mysql_db_query("$database",$query);

  if(mysql_num_rows($res)>0)

   {$i=1;

   while($ping=mysql_fetch_array($res))

    echo "评论人:$ping[name]   电子邮件:$ping[mail]
&nbsp;&nbsp;".nl2br($ping[p_cont])."
时间:$ping[time]  来自:$ping[ip]
n" ;

   }

   else

   echo "暂时没有本文章的相关评论!";

  ?>

  


      
<a

  href="javascript:window.close()">关闭窗口


    


 

相关阅读 Win10预览版怎么升级 Win10预览版升级方法厂商不再预装Win7或8.1系统,驱动人生帮您快速升级Mac移动硬盘安装win8 Mac将win装在移动硬盘使用教程windows10xboxone串流简单教程Windows Hello怎么用 Windows Hello使用设置教程win10怎么关闭自动更新 win10如何关闭自动更新Mac系统如何远程桌面到Windows系统windows update更新有用吗 windows update下载的文件在哪

文章评论
发表评论

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

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

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