<tr> <td width="40"><img src="images/first.gif" width="37" height="15" onClick="location.href=\''; echo allparam(); echo '1\'"/></td> <td width="45"><img src="images/back.gif" width="43" height="15" onClick="location.href=\''; echo allparam(); echo ''; echo $pageno - 1; echo '\'" /></td> <td width="45"><img src="images/next.gif" width="43" height="15" onClick="location.href=\''; echo allparam(); echo ''; echo $pageno + 1; echo '\'"/></td> <td width="40"><img src="images/last.gif" width="37" height="15" onClick="location.href=\''; echo allparam(); echo ''; echo $pagenum; echo '\'" /></td> <td width="100"><div align="center"><span class="STYLE1">转到第 '; $posts = $_POST; $gets = $_GET; $result = array_merge($posts, $gets); foreach ($result as $key => $value) { echo ' <input type="hidden" name="'; echo $key; echo '" value="'; echo $value; echo '" />
function splitpage($pagenum, $pagesize, $pageno) { $qnum = 5; $hnum = 5; $qpageno = $pageno - $qnum > 0 ? $pageno - $qnum : 1; $hpageno = $pageno + $hnum <= $pagenum ? $pageno + $hnum : $pagenum; echo ' <div id="pagelist"> <ul> <li>'; if ($pageno > 1) { echo '<a href="'; echo allparam(); echo '1">'; } echo '首页'; if ($pageno > 1) { echo '</a>'; } echo '</li> <li>'; if ($pageno > 1) { echo '<a href="'; echo allparam(); echo ''; echo $pageno - 1; echo '">'; } echo '上页'; if ($pageno > 1) { echo '</a>'; } echo '</li> '; for ($i = $qpageno; $i <= $hpageno; $i++) { echo ' <li '; if ($pageno == $i) { echo 'class="current"'; } echo '><a href="'; echo allparam(); echo ''; echo $i; echo '">'; echo $i; echo '</a></li> '; } echo ' <li>'; if ($pageno < $pagenum) { echo '<a href="'; echo allparam(); echo ''; echo $pageno + 1; echo '">'; } echo '下页'; if ($pageno < $pagenum) { echo '</a>'; } echo '</li> <li>'; if ($pageno < $pagenum) { echo '<a href="'; echo allparam(); echo ''; echo $pagenum; echo '">'; } echo '尾页'; if ($pageno < $pagenum) { echo '</a>'; } echo '</li> <li class="pageinfo">'; echo $pageno . "/" . $pagenum; echo '</li> </ul> <form action="" method="post"> '; $posts = $_POST; $gets = $_GET; $result = array_merge($posts, $gets); foreach ($result as $key => $value) { echo ' <input type="hidden" name="'; echo $key; echo '" value="'; echo $value; echo '" /> '; } echo ' <input name="pageno" size="6" type="text"> <input name="go" type="submit" value="Go"> '; echo "每页:" . $pagesize . "条"; echo '</form> </div> '; }