A
Anonymous
Guest
HI guys,
I am trying to do page numbering for my results page. At the moment, everything works fine but I wish to create a page reference in my results page.
For your information, i can see all the pages avaiable(i set the query limit to 10 results per page) at the bottom of my page. The problem is, it doesn't show me which page i am viewing. When i press page 3, the page 3 still an active hyperlink shown at the bottom.
I am wondering is there anyway i make amend the code so i know which page i am viewing instead of guessing which page i am viewing ?
Please advise.
my code:
if ($Total > 0)
{
if ($Result_Set<$Total && $Result_Set>0)
{
$Res1 = $Result_Set - $Per_Page;
echo "<a href=\"".$_SERVER['PHP_SELF']."?$page_no=$c&Result_Set=$Res1&c_category=".$_REQUEST['c_category']."&c_country=".$_REQUEST['c_country']."&c_state=".$_REQUEST['c_state']."&c_desc=".$_REQUEST['c_desc']."&c_name=".$_REQUEST['c_name']."\"><b><< Previouse Page </b></a>";
}
//calculate and display page #links
$Pages = $Total / $Per_Page;
if ($Pages>1)
{
for ($b=0,$c=1; $b< $Pages; $b++, $c++)
{
$Res1=$Per_Page * $b;
echo "<a href=\"".$_SERVER['PHP_SELF']."?$page_no=$c&Result_Set=$Res1&c_category=".$_REQUEST['c_category']."&c_country=".$_REQUEST['c_country']."&c_state=".$_REQUEST['c_state']."&c_desc=".$_REQUEST['c_desc']."&c_name=".$_REQUEST['c_name']."\"><b>$c</b></a>\n";
}
}
if ($Result_Set>=0 && $Result_Set<$Total)
{
$Res1=$Result_Set+$Per_Page;
if($Res1<$Total)
{
echo "<a href=\"".$_SERVER['PHP_SELF']."?$page_no=$c&Result_Set=$Res1&c_category=".$_REQUEST['c_category']."&c_country=".$_REQUEST['c_country']."&c_state=".$_REQUEST['c_state']."&c_desc=".$_REQUEST['c_desc']."&c_name=".$_REQUEST['c_name']."\"><b>Next Page >></b></a>";
}
}
}
I am trying to do page numbering for my results page. At the moment, everything works fine but I wish to create a page reference in my results page.
For your information, i can see all the pages avaiable(i set the query limit to 10 results per page) at the bottom of my page. The problem is, it doesn't show me which page i am viewing. When i press page 3, the page 3 still an active hyperlink shown at the bottom.
I am wondering is there anyway i make amend the code so i know which page i am viewing instead of guessing which page i am viewing ?
Please advise.
my code:
if ($Total > 0)
{
if ($Result_Set<$Total && $Result_Set>0)
{
$Res1 = $Result_Set - $Per_Page;
echo "<a href=\"".$_SERVER['PHP_SELF']."?$page_no=$c&Result_Set=$Res1&c_category=".$_REQUEST['c_category']."&c_country=".$_REQUEST['c_country']."&c_state=".$_REQUEST['c_state']."&c_desc=".$_REQUEST['c_desc']."&c_name=".$_REQUEST['c_name']."\"><b><< Previouse Page </b></a>";
}
//calculate and display page #links
$Pages = $Total / $Per_Page;
if ($Pages>1)
{
for ($b=0,$c=1; $b< $Pages; $b++, $c++)
{
$Res1=$Per_Page * $b;
echo "<a href=\"".$_SERVER['PHP_SELF']."?$page_no=$c&Result_Set=$Res1&c_category=".$_REQUEST['c_category']."&c_country=".$_REQUEST['c_country']."&c_state=".$_REQUEST['c_state']."&c_desc=".$_REQUEST['c_desc']."&c_name=".$_REQUEST['c_name']."\"><b>$c</b></a>\n";
}
}
if ($Result_Set>=0 && $Result_Set<$Total)
{
$Res1=$Result_Set+$Per_Page;
if($Res1<$Total)
{
echo "<a href=\"".$_SERVER['PHP_SELF']."?$page_no=$c&Result_Set=$Res1&c_category=".$_REQUEST['c_category']."&c_country=".$_REQUEST['c_country']."&c_state=".$_REQUEST['c_state']."&c_desc=".$_REQUEST['c_desc']."&c_name=".$_REQUEST['c_name']."\"><b>Next Page >></b></a>";
}
}
}