Jump to & lt;? in firefox ;? Php & nbsp; header (& quot; Content-Type: text/html; charset = GB2312 & quot;); & nbsp; $ pagesize = 10; & nbsp; // echo $ _ POST ['Page']; & n jump under firefox
Header ("Content-Type: text/html; charset = GB2312 ");
$ Pagesize = 10;
// Echo $ _ POST ['Page'];
$ Db = mysql_connect ("localhost", "root", ""); // create a database connection
Mysql_query ("set character set GB2312 ");
# Mysql_query ("set names UTF-8 ");
Mysql_select_db ("pagelist ");
$ Result = mysql_query ("select * FROM sheet1", $ db );
$ Myrow = mysql_fetch_array ($ result );
$ Numrows = mysql_num_rows ($ result );
$ Pages = intval ($ numrows/$ pagesize );
If ($ numrows % $ pagesize)
$ Pages ++;
If (isset ($ _ POST ['Page']) {
$ Page = intval ($ _ POST ['Page']);
}
Else {
// Set it to the first page
$ Page = 1;
}
$ First = 1;
$ Prev = $ page-1;
$ Next = $ page + 1;
$ Last = $ pages;
// Calculate the record offset
$ Offset = $ pagesize * ($ page-1 );
// Read the specified number of records
// $ Result = mysql_query ("select 'id', count (*) from ". book. "group by 'id' order by id desc limit $ offset, $ pagesize ");
$ Result = mysql_query ("select * from sheet1 limit $ offset, $ pagesize ");
$ Num = mysql_num_rows ($ result );
While ($ row = mysql_fetch_array ($ result, $ db )){
$ Pipeline name [] = $ row [0];
$ Name [] = $ row [1];
$ Author [] = $ row [2];
$ Publisher [] = $ row [3];
$ Isbn [] = $ row [4];
$ Type [] = $ row [5];
$ Smallpic [] = $ row [6];
// $ Countpeople [] = $ row [1];
}
Echo"
\ N ";Echo"
\ N ";Echo"
ID |
Name |
Author |
Press |
ISBN No. | ";For ($ a = 0; $ a <$ num; $ a ++){Echo"
\ N ";Echo"
". $ Pipeline name [$ a].") | ";Echo"
". $ Name [$ a]." | ";Echo"
". $ Author [$ a]." | ";Echo"
". $ Publisher [$ a]." | ";Echo"
". $ Isbn [$ a]." | ";Echo"
". $ Type [$ a]." | ";# Echo"
| ";Echo"
";}Echo"
\ N ";
Echo"
Echo "border = 0> ";
Echo"";
Echo "";
Echo"
". $ Page." page/total ". $ pages." page | total ". $ numrows." | ";
If ($ page> 1) echo "homepage | ";
If ($ page> 1) echo "previous page | ";
If ($ page <$ pages) echo "next page | ";
If ($ page <$ pages) echo "last page ";