===== Article. php ====
<?
If (! Isset ($ pagenum )){
$ Pagenum = 1 ;}
$ Conn = mysql_connect ("localhost", "user", "password ");
Mysql_select_db ("Bamboo ");
$ SQL = "select count (*) from article ";
$ Result = mysql_query ($ SQL, $ conn );
$ COUNT = mysql_result ($ result, 0 );
$ Sign = 0;
$ Lesssign = 0;
$ Pagec = 1;
For ($ icount = 0; ($ icount <$ count) & ($ Sign = 0); $ icount + = 16 ){
For ($ I = 0; $ I <= 16; $ I ++ ){
If ($ icount * 16 + $ I) = $ count)
$ Sign = 1;
}
$ Pagec ++;
}
$ Dispeof = 16 * $ pagenum;
$ Dispend = 16 * ($ pagenum-1 );
If ($ count> = (16 * $ pagenum ))
$ Dispbeg = 16 * $ pagenum;
Else
$ Dispbeg = $ count;
$ Isdispnum = $ count-$ dispeof;
If ($ isdispnum <0 ){
$ Lesssign = 1;
}
Echo "& lt; table width = 100% & gt ";
$ Fuhao = "◇ ";
$ Color = e9eae9;
$ Iscolor = 0;
$ Lessnum = 0;
For ($ I = $ dispbeg; $ I >$ dispend; $ I --){
$ SQL = "select * from article where id = '$ I '";
$ Result = mysql_query ($ SQL, $ conn );
Echo "<tr> <TD align = left bgcolor = $ color> ";
Echo $ fuhao;
Echo "<a href = articledisp. php? Article_id = $ I> ";
$ OBJ = mysql_fetch_object ($ result );
Echo $ obj-> articlename;
Echo "</a> </TD> </tr> ";
$ Lessnum ++;
If ($ iscolor = 0 ){
$ Color = ffffff;
$ Iscolor = 1;
}
Else {
$ Color = e9eae9;
$ Iscolor = 0;
}
}
If ($ lesssign = 1 ){
For ($ iless = $ lessnum; $ iless <= 16; $ iless ++ ){
Echo "<tr bgcolor = $ color> <TD> ";
Echo $ fuhao. "<br> N ";
Echo "</TD> </tr> ";
If ($ iscolor = 0 ){
$ Color = ffffff;
$ Iscolor = 1;
}
Else {
$ Color = e9eae9;
$ Iscolor = 0;
}
}
}
Echo "</table> ";
?>
</TD>
</Tr>
</Table>
<?
Echo "<Table width = 100% bgcolor = 00ff00> ";
$ STR = "Total ";
$ STR = $ Str. strval ($ pagec );
$ STR = $ Str. "Page ";
Echo "<tr> <TD> $ Str ";
Echo "</TD> ";
Echo "<TD align = center> ";
$ STR = "the current page is ";
$ STR = $ Str. strval ($ pagenum );
$ STR = $ Str. "Page ";
Echo $ STR;
Echo "</TD> ";
Echo "<TD> ";
Echo "go to ";
For ($ I = 1; $ I <= $ pagec; $ I ++ ){
$ Strpage = "";
$ Strpage = $ strpage. strval ($ I );
$ Strpage = $ strpage ."";
Echo "<a href = articlcont. php? Pagenum = $ I >$ strpage </a> ";
}
Echo "page ";
Echo "</TD> ";
Echo "</tr> ";
Echo "</table> ";
Mysql_close ($ conn );
?>
(To be continued)