【发布时间】:2025-11-15 16:45:01
【问题描述】:
我想在显示页码的分页底部添加三个类,我在 PHP 中使用了它,但我不知道将类名放在 php echo 中的哪个位置才能工作......因为我得到了错误...
class="box_one" for ... << Prev Page
class="box_two" for ... echo $thenumrows or $i
class= "box_three" ... Next Page >>
这里是代码...
<?php
if ($thenumrows != "")
{
echo "<br>";
if ($thecurrentpage > 1)
echo "<a href='". $_SERVER['PHP_SELF'] . "?cat= ". $theselectedcat ."&rows= "
. $thenumrows ."&page=". $thepreviouspage ."'>
<< Prev Page </a> "; for ($i=1;$i<=$totalpages;$i++)
{
if ($i == $thecurrentpage)
echo $i ." ";
else
echo "<a href='". $_SERVER['PHP_SELF'] ."?cat=". $theselectedcat ."&rows=".
$thenumrows ."&page=". $i ."'>$i</a> ";
}
if ($thecurrentpage < $totalpages)
echo "<a href='". $_SERVER['PHP_SELF'] ."?cat=". $theselectedcat ."&rows=".
$thenumrows ."&page=". $thenextpage ."'>Next Page >></a> ";
}
?>
请帮忙谢谢。
上午
【问题讨论】: