社区源代码(php&mysql)之六
//以下为article.php文件(此页面用于查看帖子)
<?
  
include "../inc/sql.inc.php";
  include 
"../inc/header.inc";

  
$sql="select read_value from bbs where bbsid='$bbsid'";
  
$result=mysql_query($sql);
  
$row=mysql_fetch_array($result);

  
$read_value=$row[read_value];
  
$read_value++;

  
$sql="update bbs set read_value='$read_value' where bbsid='$bbsid'";
  
mysql_query($sql);

  
$sql="select * from bbs where bbsid='$bbsid'";
  
$result=mysql_query($sql);
  
$row=mysql_fetch_array($result);

  
$bbstitle=$row[blockid];
  
$title=$row[title];
  
$content=$row[content];
  
$writer=$row[writer];
  
$writetime=$row[writetime];

  switch(
$bbstitle){
  case
"1"$bbs_title="【HTML】";break;
  case
"2"$bbs_title="【PHP】";break;
  case
"3"$bbs_title="【JSP】";break;
  case
"4"$bbs_title="【CSS】";break;
  case
"5"$bbs_title="【SCRIPT】";break;
  case
"6"$bbs_title="【LINUX】";break;
  }

  
$sql="select * from bbs where blockid='$bbstitle'";
  
$result=mysql_query($sql);
  
$total=mysql_num_rows($result);

?>
<html>
<head>
<title>ARTICLE</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/internal.css" rel=stylesheet>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width=100% border="0" cellpadding="0" cellspacing="1">
  <tr>
    <td valign="center" height="29" colspan="3" >版面:<font color="ff0000"><?echo $bbs_title;?></font></td>
    <td valign="center" colspan="2">斑竹:<font color="ff0000">尹云飞 </font></td>
    <td valign="center" colspan="3">本栏目共有<font color="ff0000">【<?echo $total;?>】</font>篇文章</td>
    <td valign="center" colspan="2"><a href="writing.php?id=<?echo $id;?>&bbstitle=<?echo $bbstitle;?>" target="_self"><? echo (isset($id)) ? "发表文章":"";?></a></td>
    <td width="75" valign="center"><a href="writing.php?bbstitle=<?echo $bbstitle?>" target="_self">精华区</a></td>
  </tr>
</table><BR>
<TABLE border="1" cellspacing="0" cellpadding="0" bordercolordark="#ffffff" bordercolorlight="#000000" width=95%>
  <TR>
     <TD>
<TABLE>
<TR>
    <TD>&nbsp;&nbsp;</TD>
    <TD>文章标题::"<? echo $title?>"</TD>
    <TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    <TD>作者::<?echo $writer?></TD>
    <TD>&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    <TD>发表时间::<?echo date("Y.m.d H:i",$writetime);?></TD>
    <TD>&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    <TD><a href=# onclick="javascript:history.go(-1)">返回&nbsp;&nbsp;&nbsp;</a></TD>
</TR>
</TABLE>
     </TD>
  </TR>
  <TR>
     <TD> 
<TABLE>
<TR>
    <TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    <TD><pre><FONT SIZE="3"><? echo $content?></FONT></pre></TD>
    <TD>&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
<BR>
    </TD>
  </TR>
</TABLE>
<? include "../inc/copyright.inc"?>
<BR>
</body>
</html>


//以下为error.php文件(此页面用于判断出错原因)
<HTML>
<HEAD>
<TITLE>错啦! </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>

<BODY>
 <BR><BR><center><FONT SIZE="3" COLOR="#ff2200">
 <? 
    
if($error==1) echo "SORRY!用户名或密码不能为空!";
    if(
$error==2) echo "SORRY!密码错误!";
    if(
$error==3) echo "SORRY!主题不能为空!";
    if(
$error==4) echo "SORRY!这个主题已存在,您还是费费神再想一个吧!^O^";
 
?>
 <a href="javascript:history.go(-1)">还是返回吧!</a></FONT></center>
</BODY>
</HTML>

//以下为cright.css文件
TD {
    FONT-SIZE: 9pt
}
A {
    FONT-SIZE: 9pt; COLOR: #0000ff; TEXT-DECORATION: none
}
A:hover {
    COLOR: #ffffff;FONT-FAMILY: "Verdana", "Arial", "Helvetica", "sans-serif", "宋体"; TEXT-DECORATION: none; FONT-SIZE: 9pt
}
A:active {
    COLOR: #ffffff
}
.TextBorder {
    BORDER-BOTTOM: rgb(66,66,99) 1px solid; BORDER-LEFT: rgb(66,66,99) 1px solid; BORDER-RIGHT: rgb(66,66,99) 1px solid; BORDER-TOP: rgb(66,66,99) 1px solid; FONT-SIZE: 9pt
}


//以下为internal.php文件
td{font-size:9pt}
   A {
    FONT-SIZE: 9pt; COLOR: #0000ff; TEXT-DECORATION: none
}
A:hover {
    COLOR: #ff0000;TEXT-DECORATION: none; FONT-SIZE: 9pt
}
A:active {
    COLOR: #ff0000;FONT-SIZE:9pt
}
BODY {
    SCROLLBAR-FACE-COLOR: #00EEFF; FONT-SIZE: 11pt; SCROLLBAR-HIGHLIGHT-COLOR: #FFEEFF; SCROLLBAR-SHADOW-COLOR: #4873b9; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #00cccc; FONT-FAMILY: 宋体, Arial; SCROLLBAR-DARKSHADOW-COLOR: #000000
}