##############index.php###################### 
<?session_start(); 
require"./inc/func.php"; 
mscon(); 
require "./inc/header.inc"; 
?> 
<script language="javascript"> 
function opwin(filename) 
{
window.open("read_article.php?id="+filename,"","height=500,width=585,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); 
}

</script> 
</head> 
<body bgcolor="#FFFFFF"
text="#000000" leftmargin="0" topmargin="0"> 
<table width="100%"
border="0" cellspacing="0" cellpadding="0"
bgcolor="#003399" height="23"> 
<tr> 
<td width="80"> 
<div id="Layer2"
style="position:absolute; left:7px; top:17px; width:43px; height:44px;
z-index:2"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="80" height="60"> 
<param name=movie
value="images/logo.swf"> 
<param name=quality value=high> 
<param name="wmode"
value="transparent"> 
<embed src="data:images/logo.swf"
quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="80"
height="60" wmode="transparent"> 
</embed> 
</object></div> 
<div id="Layer1"
style="position:absolute; left:-5px; top:61px; width:49px; height:37px;
z-index:1"><img src="data:images/11.gif" width="58"
height="55"></div> 
</td> 
<td width="539"> <object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="468" height="60"> 
<param name=movie
value="images/ti1.swf"> 
<param name=quality value=high> 
<param name="wmode"
value="transparent"> 
<embed src="data:images/ti1.swf"
quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="468"
height="60" wmode="transparent"> 
</embed>

</object> </td> 
</tr> 
</table> 
<table width="100%"
border="0" cellspacing="0" cellpadding="0"> 
<tr> 
<td background="images/211.gif"
height="2">&nbsp;</td> 
</tr> 
</table> 
<table><FORM name=form1
action=search.php method=post target=_blank> 
<table width="80%"
border="0" cellspacing="0" cellpadding="0"
bgcolor="#009933" align="center"> 
<tr> 
<td align="center"> 
<input type="text"
name="key"> 
<select name="type"> 
<option value=>全部類別</option> 
<? $typ=file("list.txt"); 
$num=count($typ); 
for($i=2;$i<=$num;$i++) 

echo"<option
value=$typ[$i]>$typ[$i]</option>";} 
?> 
</select> 
<select name="whe"> 
<option value=>全部內容</option> 
<option value=1>文章內容</option> 
<option value=2>文章標題</option> 
<option value=3>加入時間</option> 
</select> 
<input type="hidden"
name="submit" value="1"> 
<input type="submit"
name="submit" value="提交查詢"> 
</td> 
</tr> 
</table> 
</FORM></table> 
<? 
$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 "<table width="80%"
border="0" cellspacing="0" cellpadding="0"
align=center>"; 
echo "<tr><td>共:".$total."篇".$total_page."頁</td></tr>"; 
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]="<font
color=#FF9900>$topic[time]</font>"; 
echo"
<tr><td>[$topic[type]]<a href=#
onClick="opwin($topic[id])";>$topic[title]</a><font
size=1>($topic[time])</font>"; 
if($topic[comm]==1) 
echo "<img src="./images/comm.gif"
alt="精品文章">"; 
if($topic[locked]==1) 
echo "<img
src="./images/locked.gif" alt="文章已鎖定">"; 
echo "</td> 
<td>閱讀:$topic[hits]
次;評論:$topic[p_num]次</td> 
</tr>"; 

else 
echo " 對不起,本欄 目暫沒有任何文章!!!"; 
echo "</table>"; 
?>

<br> 
<table width="80%"
border="0" cellspacing="0" cellpadding="0"
align="center"> 
<tr> 
<td> 
<? 
$pre=$page-1; 
$next=$page+1; 
if($page>0) 
echo "<a
href="$php_self?page=$pre&type=$type">上一頁</a><br><br>"; 
else 
echo "上一頁<br><br>";
?></td> 
<td><?if($page<$total_page-1) 
echo " <a
href="$php_self?page=$next&type=$type">下一頁</a><br><br>"; 
else echo " 下一頁<br><br>";?></td> 
<td> 
<form> 跳轉到: 
<select name="page"
onchange="top.location='<? echo
$php_self;?>?page='+document.forms[1].elements[0].value+'&type=<?echo
$type;?>';" class="border"> 
<? 
for($i=0;$i<$total_page;$i++) 

$p=$i+1; 
echo "<option value=$i"; 
if($page==$i) echo " selected" ; 
echo ">第".$p."頁</option>n"; 

?> 
</select> </form> 
</td> 
<td> 
<form >選擇欄目: 
<select name="type"
onchange="top.location='<? echo
$php_self;?>?type='+document.forms[2].elements[0].value<?if($comm)
echo"+'&comm=1'";?>;" > 
<? $typ=file("list.txt"); 
$num=count($typ); 
for($i=0;$i<$num;$i++) 

echo"<option value=$typ[$i] ";
if(trim($typ[$i])==$type) { echo " selected"; } echo ">$typ[$i]</option>";} 
?> 
</select> 
</form> 
</td><td><form
method="post" action=<? echo $PHP_SELF;?>?type=<?echo
$type;?> target="_balnk"><input type="submit" name="comm"
value="精品文章"
class=border></form></td> 
</tr> 
</table> 
<?require "./inc/footer.inc";?> 
#####################read_article.php######################### 
<? 
require"./inc/func.php"; 
if(!$id) 

echo"<script>window.close();</script>"; 
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; 
?> 
<HTML> 
<HEAD> 
<TITLE> 
<? echo
"$data[title]--[$data[type]]";?> 
</TITLE> 
<META http-equiv=Content-Type
content="text/html; charset=gb2312"> 
<style type=text/css> 
<!-- 
body,table,td,input,textarea { font-family:
"細明體"; font-size: 9pt} 
select { font-family: "細明體"; font-size: 9pt} 
code {font-family: "Courier" ;
font-size: 10pt} 
a { color: #005500} 
a:hover { color: #CC0000} 
.border {border: 1px #000000 solid;
background-color:transparent; list-style-position: inside; list-style-type:
square} 
--> 
</style> 
<script language="javascript"> 
function name() 

var theResult = true; 
var elem4 = null;

if (document.forms[0].elements[0].value ==
"" || document.forms[0].elements[0].value == "undefined" ||
document.forms[0].elements[0].value == "null") 

elem4 = prompt("請輸入您的姓名:",""); 
theResult = false; 
document.forms[0].elements[0].value = elem4; 

return theResult; 

function mail() 

var theResult = true; 
var elem1 = null 
if
((document.forms[0].elements[1].value.indexOf('@') == -1 || document.forms[0].elements[1].value
== "" || document.forms[0].elements[1].value.indexOf('.') == -1)) 

elem1 = prompt("請輸入您的正確的電子郵件地址。謝謝!!",""); 
theResult = false; 
document.forms[0].elements[1].value = elem1; 

return theResult; 

function go() 

var theResult=true; 
theResult = name()&&mail(); 
return theResult; 

</script> 
</HEAD> 
<BODY text=#000000 bgColor=#ffffff> 
<TABLE borderColor=#339933 cellSpacing=0
borderColorDark=#ffffff 
cellPadding=0 align=center
borderColorLight=#000000 border=1 width=545> 
<TBODY> 
<TR vAlign=center bgColor=#009900> 
<TD background=images/third-back3.gif> 
<TABLE cellSpacing=0 cellPadding=0 width=100%
border=0> 
<TBODY> 
<TR> 
<TD width=17>&nbsp;</TD> 
<TD width=590> 
<TABLE width="36%" align=center
border=0> 
<TBODY> 
<TR> 
<TD bgcolor="#009900"> 
<DIV align=center><FONT
face="Verdana, Arial, Helvetica, sans-serif"
color=#ffffff><b> 
<? echo $data[title];?> 
</b></FONT></DIV> 
</TD></TR></TBODY></TABLE></TD> 
<TD width=19> 
<DIV align=center><A
href="javascript:window.close()"><IMG height=17 
src="data:images/third-close.gif" width=17
align=absMiddle 
border=0
name=content_r03_c28></A></DIV> 
</TD></TR></TBODY></TABLE></TD></TR> 
<TR vAlign=center align=left
bgColor=#cccccc> 
<TD> 
<TABLE cellSpacing=0 cellPadding=0 border=0 align="center"
width="100%"> 
<TBODY> 
<TR> 
<TD> 
<DIV align=left><A class="whitetxt" 
href="read_article.php?id=<? echo
$pre;?>"><img src="data:images/prethread.gif"
width="48" height="12"
border="0"></A></DIV> 
</TD> 
<TD> 
<DIV align=left><a class="whitetxt" 
href="read_article.php?id=<? echo
$next;?>"><img src="data:images/nextthread.gif"
width="48" height="12"
border="0"></a></DIV> 
</TD> 
<TD><IMG 
height=16 src="data:images/mail.gif"
width=16></TD> 
<TD class="myfont"><A class="redtxt" 
href="commend.php?id=<? echo "$data[id]&title=$data[title]";?>">推薦給朋友</A></TD> 
<TD> 發表時間: 
<? echo $data[time];?> 
閱讀次數: 
<? echo $data[hits];?> 
</TD> 
<TD>&nbsp; </TD> 
</TR> 
</TBODY> 
</TABLE> 
</TD></TR> 
<TR vAlign=top> 
<TD class="tenpt"> 
<? 
if($data[locked]<>0) 

echo "<img src=images/lock.gif>對不起!本文已經被管理員鎖定!"; 

else 
if($data[html]==1) 
highlight_string($data[cont]); 
else 
echo nl2br($data[cont]); 
?> 
</TD> 
</TR> 
</TBODY></TABLE> 
<table bordercolor=#339933 cellspacing=0
bordercolordark=#ffffff 
cellpadding=0 align=center bordercolorlight=#000000
border=1 width=545> 
<tbody> 
<TR bgColor=#cccccc> 
<th> 
<DIV align=center>發表評論</DIV> 
</th> 
</TR> 
<tr> 
<td> 
<form name="form1"
method="post" action="ping.php" onsubmit="return
go()"> 
您的姓名: 
<input type="text"
name="name" class="border"> 
&nbsp;&nbsp;您的電子郵件: 
<input type="text"
name="mail" size=20 class="border"> 
僅站長可見:<input type="checkbox"
name="pub" value="<? echo $data[title];?>"> 
<input type="hidden"
name="p_id" value="<? echo $id;?>"> 
<br> 
發表評論: 
<textarea name="cont"
rows="8" cols="85"></textarea> 
<br> 
<br> 
<center> 
<input type="submit"
name="Submit" value="提交"
class="border"> 
<input type="reset"
name="Submit2" value="重寫"
class="border"> 
</center></form> 
</td> 
</tr> 
<TR bgColor=#cccccc> 
<th> 
<DIV align=center>相關評論</DIV> 
</th> 
</TR> 
<tr> 
<td> 
<? $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]<br>&nbsp;&nbsp;".nl2br($ping[p_cont])."<br>時間:$ping[time] 來自:$ping[ip]<hr
size=1>n" ; 

else 
echo "暫時沒有本文章的相關評論!"; 
?> 
</td> 
</tr> 
<tr bgcolor=#cccccc> 
<td> 
<div align=center><a 
href="javascript:window.close()">關閉窗口</a></div> 
</td> 
</tr> 
</tbody> 
</table> 
<?require "./inc/footer.inc";?>。

PHP文章管理(2)的更多相关文章

  1. ASP.NET MVC5 网站开发实践(二) Member区域 - 文章管理架构

    上次把member的用户部分完成,现在开始做文章管理部分.文章部分根据涉及显示现实文章列表,发布文章,修改文章,删除文章等功能.最终的实现目标是使用权限来控制用户是否能进行相应操作,管理员权限的会显示 ...

  2. PHP文章管理

    功能说明:  文章的基本操作:添加,修改,锁定,解锁,推荐,删除等待  并有强大功能的搜索,评论,推荐给朋友等功能,并对安全性进行着重加强,漂亮的界面人性化的设计.  主要文件列表:  setup.p ...

  3. PHPCMS v9在后台文章管理列表添加类别

    进入PHPCMS v9后台—内容,进入PHPCMS的文章管理列表,要实现在文章标题前显示文章类别,就是可以直接在文章列表里看到类别,不需要点击进入编辑页面才可以看到,如下图: PHPCMS v9在后台 ...

  4. Java EE 学习(9):IDEA + maven + spring 搭建 web(5)- 博客文章管理

    转载:Gaussic(一个致力于AI研究却不得不兼顾项目的研究生) . 注:在阅读本文前,请先阅读: Java EE 学习(5):IDEA + maven + spring 搭建 web(1) Jav ...

  5. 使用IntelliJ IDEA开发SpringMVC网站(五)博客文章管理

    原文:使用IntelliJ IDEA开发SpringMVC网站(五)博客文章管理 摘要 通过对博客文章的管理,实现外键操作. 目录[-] 八.博客文章管理 1.查看文章 2.添加博客        3 ...

  6. 用 Flask 来写个轻博客 (30) — 使用 Flask-Admin 增强文章管理功能

    Blog 项目源码:https://github.com/JmilkFan/JmilkFan-s-Blog 目录 目录 前文列表 扩展阅读 实现文章管理功能 实现效果 前文列表 用 Flask 来写个 ...

  7. ASP.NET MVC 实现页落网资源分享网站+充值管理+后台管理(8)之文章管理

    到这一步,我们整个项目的核心搭建已经算是完成了,接下来就是我们业务功能的实际应用,也就是表现层的设计和实现,如果你是一个项目负责人,到这一步,接下来的工作就可以交给下面的兄弟去完成了,在这里我们用文章 ...

  8. cms_文章管理

    文章管理 文章管理前端页面 把引入的多个布局抽成了公共代码 <%@ page language="java" contentType="text/html; cha ...

  9. Laravel建站04--建立后台文章管理

    路由配置 Route::group(['middleware' => 'auth', 'namespace' => 'Admin', 'prefix' => 'admin'], fu ...

随机推荐

  1. <frameset><frame><iframe>网页框架

    这几个标签都属于同一类功能,就是框架内镶功能: 1)<frameset>意为把页面分解成一定部分,让每一部分显示不同的内镶框架,如(请复制到DW尝试): <html> < ...

  2. EDM(邮件营销)

    官冲拉手网CTO举了个EDM(邮件营销)的例子: 在做大数据分析应用之前,通过EDM带来的订单转化率很低.在采用大数据解决方案后,可以根据用户之前的浏览习惯猜测他的喜好和购买习惯,从而针对性的推送个性 ...

  3. JAVA中的Transient

    Java中的transient,是用于声明序列化的时候不被存储的. 例子: package ThreadTest; /** * Created with IntelliJ IDEA. * User: ...

  4. Java---IO加强(2)

    转换流 ★转换流功能1:充当字节流与字符流之间的桥梁 需求:模拟英文聊天程序,要求: (1) 从键盘录入英文字符,每录一行就把它转成大写输出到控制台: (2) 保存聊天记录到字节流文件. 要求1的设计 ...

  5. Ubuntu 用户及组管理

    $是普通管员,#是系统管理员,在Ubuntu下,root用户默认是没有密码的,因此也就无法使用(据说是为了安全).想用root的话,得给root用户设置一个密码:sudo passwd root然后登 ...

  6. HDU3631:Shortest Path(Floyd)

    Problem Description When YY was a boy and LMY was a girl, they trained for NOI (National Olympiad in ...

  7. 沧海一声笑,移动应用的CRASH原因我找到! --记最新款数字化測试“星云測试“的使用攻略

    沧海一声笑,移动应用的CRASH原因我找到! --记最新款数字化測试"星云測试"的使用攻略 世界进步那么快,非常多新奇的点子层出不穷,于是我们创业.我们做最酷的手机应用,做最轰炸的 ...

  8. Linux入门基础 #6:Linux用户基础

    本文出自   http://blog.csdn.net/shuangde800 ------------------------------------------------------------ ...

  9. unity3d触屏操作对象运动

    using UnityEngine; using System.Collections; public class robot : MonoBehaviour { private GameObject ...

  10. Target runtime Apache Tomcat v6.0 is not defined. phyy Unknown Faceted Project Problem

    Description Resource Path Location TypeTarget runtime Apache Tomcat v6.0 is not defined. phyy Unknow ...