BBS (PHP & MySQL) full version (iii)

Source: Internet
Author: User
Tags mysql
This page is php3.php
?
Include "Signup/mysql.inc";
Switch ($part) {
Case "1": $table = "bbs_php";
Case "2": $table = "Bbs_mysql";
Case "3": $table = "bbs_html";
Case "4": $table = "Bbs_js";
}
Echo $part;
?>

<title>xiaoyang</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<script language= "JavaScript1.2" src= "Js/menu_comment.js" ></script>
<script language= "JavaScript1.2" src= "Js/fw_menu.js" ></script>
<script language= "JavaScript" >
<!--
function Mm_reloadpage (init) {//reloads the window if Nav4 resized
if (init==true) with (navigator) {if (appname== "Netscape") && (parseint (appversion) ==4)) {
Document. Mm_pgw=innerwidth; Document. Mm_pgh=innerheight; Onresize=mm_reloadpage; }}
else if (innerwidth!=document. MM_PGW | | Innerheight!=document. MM_PGH) location.reload ();
}
Mm_reloadpage (TRUE);
-->
</script>

<body bgcolor= "#FFFFFF" text= "#000000" >
<div id= "Layer1" style= "Position:absolute; left:31px; top:1px; width:560px; height:46px; Z-index:10 ">
<script language= "JavaScript1.2" >fwloadmenus ();</script></div>





<div id= "Layer2" style= "Position:absolute; left:27px; top:41px; width:600px; height:15px; Z-index:2 ">
</div>
<div id= "Layer3" style= "Position:absolute; left:73px; top:10px; width:2px; height:330px; Z-index:3; Background-color: #ff9999; Layer-background-color: #ff9999; border:1px None #000000 "></div>
<div id= "Layer4" style= "Position:absolute; left:560px; top:10px; width:2px; height:330px; Z-index:4; Background-color: #ff9999; Layer-background-color: #ff9999; border:1px None #000000 "></div>
<div id= "Layer5" style= "Position:absolute; left:86px; top:58px; width:464px; height:273px; Z-index:5 ">
<table width= "100%" border= "0" cellspacing= "1" cellpadding= "0" height= ">"
<tr>
&LT;TD width= "10%" >
<div align= "center" ><font color= "#CC33CC" size= "2" > Popularity </font></div>
</td>
&LT;TD width= "38%" >
<div align= "center" ><font color= "#CC33CC" size= "2" > Article Topics </font></div>
</td>
&LT;TD width= "26%" >
<div align= "center" ><font size= "2" color= "#CC33CC" > Author </font></div>
</td>
&LT;TD width= "26%" >
<div align= "center" ><font color= "#CC33CC" size= "2" > Date </font></div>
</td>
</tr>

?

$sql = "SELECT * from". $table. "ORDER by row DESC";
$result =mysql_query ($sql) or Die (Mysql_error ());
$row 1=mysql_num_rows ($result);



$row _max_page=12; Pagination calculation
$page =ceil ($row 1/$row _max_page);
$left _row= $row 1-$p * $row _max_page;
$pre _left_row= $left _row+12;
$start _row= $left _row+ $row _max_page+1;
if ($left _row<=0)
{
$start _row= $pre _left_row+1;
$left _row=0;
}



$sql = "SELECT * from". $table. "Where row< ' $start _row ' and row> ' $left _row ' ORDER by row DESC";
$result =mysql_query ($sql) or Die (Mysql_error ());

while ($row =mysql_fetch_array ($result)) {

static $i = 0;
$i + +;
if ($i%2)
$color = "CCCCFF";
else $color = "FFCCFF";
echo "<tr>";
echo "<td width=10% bgcolor=#". $color. " > ";
echo "<div align=center><font size=2 color= #3333FF >". $row ["number"]. " </font></div> ";
echo "</td>";
echo "<td width=38% bgcolor=#". $color. " > ";
echo "<div align=center><font size=2 color= #3333FF ><a href= ' look.php?id= '. $row [" id "]." &&table= ". $table." ' > ". $row [" title "]." </a></font></div> ";
echo "</td>";
echo "<td width=26% bgcolor=#". $color. " > ";
echo "<div align=center><font size=2 color= #3333FF >". $row ["userid"]. " </font></div> ";
echo "</td>";
echo "<td width=26% bgcolor=#". $color. " > ";
echo "<div align=center><font size=2 color= #3333FF >". $row ["Date1"]. " </font></div> ";
echo "</td> </tr>";

}

echo "</table>";
echo "<br><div Align=center><table><tr><td><font size=2 >";
for ($i =1; $i <= $page; $i + +)
{
echo "<a href= '". $PHP _self. "? P= ". $i." &&table= ". $table." ' >[". $i."] </a> ";
}
?>
</FONT></td></tr>
</table></div>
</div>
<div id= "Layer6" style= "Position:absolute; left:409px; top:29px; width:118px; height:17px; Z-index:6 "></div>
<div id= "Layer7" style= "Position:absolute; left:451px; top:28px; width:65px; height:12px; Z-index:8 ">
<a href= "Say.php?table=<?echo $table;? > "target=" _self "><font size=" 2 "color=" #FF33FF "> I want to speak </font></a></div>
<p> </p>
<p> </p>
</body>


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.