<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_65625"> <div class="blockcode"> <div id="code_yJi"><ol> <li><?php<li> function pageSplit($startPos, $rowsPerPage = '', $totalRows = '' )<li> {<li> <li> $numPages = $totalRows / $rowsPerPage ;<li> $tenthPages = $rowsPerPage * 10 ;<li> If($startPos >= $tenthPages )</li> <li> {</li> <li> $back10Position = $startPos - $tenthPages ;</li> <li> $pageString .= '<a href="'.$PHP_SELF.'?startPos='.$back10Position .'&perPageDisplay='.$rowsPerPage.'" title="Previous 10 Pages"><font color="red"><< </font></a> ';</li> <li> }</li> <li> </li> <li> if($startPos >= $rowsPerPage)</li> <li> {</li> <li> $backPosition = $startPos - $rowsPerPage;</li> <li> $pageString .= '<a href="'.$PHP_SELF.'?startPos='.$backPosition.'&perPageDisplay='.$rowsPerPage.'" title="Previous Page"><font color="blue">Back</a></font> ';</li> <li> }</li> <li> </li> <li> if($totalRows != '')</li> <li> {</li> <li> $page = ceil($startPos / $rowsPerPage);</li> <li> $pageCount = $page $numPages;</li> <li> </li> <li> $PageNo = ceil($startPos / $rowsPerPage ) ;</li> <li> // echo ' Page No ' . $PageNo ;</li> <li> for($i = 1,$pgCnt=1; $page <= $pageCount; $i = $i $rowsPerPage)<li> {<li> if ( $PageNo == $pgCnt )<li> {<li> $pageString .= ' <a href="'.$PHP_SELF.'?startPos='.$i.'&perPageDisplay='.$rowsPerPage.'" title="Page '.$pgCnt.'""><font color="red"><b>'.$pgCnt.'</b></font></a> ';</li> <li> $pgCnt ;</li> <li> }</li> <li> elseif ($i < $totalRows)<li> {<li> $pageString .= ' <a href="'.$PHP_SELF.'?startPos='.$i.'&perPageDisplay='.$rowsPerPage.'" title="Page '. $pgCnt.'"">'.$pgCnt.'</a> ';</li> <li> $pgCnt ;</li> <li> };</li> <li> </li> <li> $page ;</li> <li> };</li> <li> }</li> <li> </li> <li> $nextPosition = $startPos $rowsPerPage;</li> <li> </li> <li> if($totalRows == '')</li> <li> {</li> <li> $pageString .= '<a href="'.$PHP_SELF.'?startPos='.$nextPosition.'&perPageDisplay='.$rowsPerPage.'" title="Next Page"><font color="blue" >Next </font></a> ';</li> <li> }</li> <li> elseif($startPos < $totalRows )</li> <li> {</li> <li> If ( $nextPosition < $totalRows )</li> <li> {</li> <li> $pageString .= '<a href="'.$PHP_SELF.'?startPos='.$nextPosition.'&perPageDisplay='.$rowsPerPage.'" title="Next Page"><font color="blue" title="Next Page">Next </font></a> ';</li> <li> }</li> <li> }</li> <li> </li> <li> if($startPos < $totalRows )<li> {<li> $next10Position = $startPos $tenthPages ;<li> <li> If($next10Position < $totalRows )<li> {<li> $next10Position = $startPos $tenthPages ;<li> $pageString .= '<a href="'.$PHP_SELF.'?startPos='.$next10Position .'&perPageDisplay='.$rowsPerPage.'" title="Next 10 Pages"><font color="red"> >></font></a>';</li> <li> }</li> <li> }</li> <li> return $pageString;</li> <li> }</li> <li>?></li> </ol></div> <em onclick="copycode($('code_yJi'));">复制代码</em> </div> <br> </td></tr></table> <div class="ptg mbm mtn"> 페이지 매김, 쿼리 결과, PHP</div> <div id="comment_65625" class="cm"> </div> <div id="post_rate_div_65625"></div> <br><br>