首页 > 作文

PHP+MYSQL的文章管理系统(二)

更新时间:2023-04-06 05:59:43 阅读:1 评论:0

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

<?ssion_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″ codeba=”2弧度等于多少度/d/file/titlepic/swflash.cab width=”80″ height=”60″>

<param name=movie value=”images/logo.swf”>

<param name=quality value=high>

<param name=”wmode” value=”transparent”>

<embed src=”images/logo.swf” quality=high pluginspage=”/d/file/titlepic/shockwave-end-of-life-faq.html 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=”images/11.gif” width=”58″ height=”55″></div>

</td>

<td width=”539″> <object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″ codeba=”/d/file/titlepic/swflash.cab width=”468″ height=”60″>

<param name=movie value=”images/ti1.swf”>

<param name=quality value=high>

<param name=”wmode” value=”transparent”>

<embed src=”images/ti1.swf” quality=high pluginspage=”/d/file/titlepic/shockwave-end-of-life-faq.html 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″></td&本科学位是什么学位gt;

</tr>

</table>

<table><form name=form1 action=arch.phpmethod=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”>

<lect 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>”;}

?>

</lect>

<lect name=”whe”>

<option value=>全部内容</option>

<option value=1>文章内容</option>

<option value=2>文章标题</option>

<option value=3>加入时间</option>

</lect>

<input type=”hidden” name=”submit” value=”1″>

<input type=”submit” name=”submit” value=”提交查询”>

</td>

</tr>

</table>

</form></table>

<?

$type=trim($type);

if($comm)

{

$c=”and comm=1″;

$fir=”where comm=1″;

}

if(!empty($type))

$query=”lect count(*) from $table where type=’$type’ $c”;

el

$query=”lect count(*) from $table $fir”;

$res=mysql_db_query(“$databa”,$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($offt))

$offt=0;

$offt=$pagenum*$page;

if(!empty($type))

$query=”lect * from $table where type=’$type’ $c order by id desc limit $offt,$pagenum”;

el

$query=”lect * from $table $fir order by id desc limit $offt,$pagenum”;

$res=mysql_db_query(“$databa”,$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>”;

}

el

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_lf?page=$pre&type=$type”>上一页</a><br><br>”;

el

echo “上一页<br><br>”;?></td>

<td><?if($page<$total_page-1)

echo ”<a href=”$php_lf?page=$next&type=$type”>下一页</a><br><br>”;

el echo ”下一页<br><br>”;?></td>

<td>

<form> 跳转到:

<lect name=”page” onchange=”top.location='<? echo $php_lf;?>?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 ” lected” ;

echo “>第”.$p.”页</option>n”;

}

?>

</lect> </form>

</td>

<td>

<form &g变形记陈玉林t;选择栏目:

<lect name=”type”onchange=”top.location='<? echo $php_lf;?>?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 ”lected”; } echo “>$typ[$i]</option>”;}

?>

</lect>

</form>

</td><td><form method=”post” action=<? echo $php_lf;?>?type=<?echo $type;?> target=”_balnk”><input type=”submit” name=”comm” value=”精品文章” class=border></form></td>

</tr>

</table>

<?re丙肝感染症状quire “./inc/footer.inc”;?>

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

<?

require”./inc/func.php”;

if(!$id)

{

echo”<script>window.clo();</script>”;

exit();

}

mscon();

$query=”lect * from $table where id=’$id'”;

$res=mysql_db_query(“$databa”,$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; chart=gb2312″>

<style type=text/css>

<!–

body,table,td,input,textarea {font-family: “宋体”; font-size: 9pt}

lect {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 = fal;

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 = fal;

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></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-rif” color=#ffffff><b>

<? echo $data[title];?>

</b></font></div>

</td></tr></tbody></table></td>

<td width=19>

<div align=center><a href=”javascript:window.clo()”><img height=17

src=”images/third-clo.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=”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=”images/nextthread.gif” width=”48″ height=”12″ border=”0″></a></div>

</td>

<td><img

height=16 src=”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> </td>

</tr>

</tbody>

</table>

</td></tr>

<tr valign=top>

<td class=tenpt>

<?

if($data[locked]<>0)

{

echo “<img src=images/lock.gif>对不起!本文已经被管理员锁定!”;

}

el

if($data[html]==1)

highlight_string($data[cont]);

el

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”>

您的电子邮件:

<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=”ret” name=”submit2″ value=”重写” class=”border”>

</center></form>

</td>

</tr>

<tr bgcolor=#cccccc>

<th>

<div align=center>相关评论</div>

</th>

</tr>

<tr>

<td>

<?$query=”lect * from $ping_tab where p_id=’$id’ order by time desc”;

$res=mysql_db_query(“$databa”,$query);

if(mysql_num_rows($res)>0)

{$i=1;

while($ping=mysql_fetch_array($res))

echo “评论人:$ping[name]电子邮件:$ping[mail]<br>“.nl2br($ping[p_cont]).”<br>时间:$ping[time]来自:$ping[ip]<hr size=1>n” ;

}

el

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

?>

</td>

</tr>

<tr bgcolor=#cccccc>

<td>

<div align=center><a

href=”javascript:window.clo()”>关闭窗口</a></div>

</td>

</tr>

</tbody>

</table>

<?require “./inc/footer.inc”;?>

本文发布于:2023-04-06 05:59:19,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/5ed6e6af53490cde064cdb4d2e0a6227.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:PHP+MYSQL的文章管理系统(二).doc

本文 PDF 下载地址:PHP+MYSQL的文章管理系统(二).pdf

标签:您的   文章   下一页   上一页
相关文章
留言与评论(共有 0 条评论)
昵称:
匿名发表 登录账号
         
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图