Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 711503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:44:33+00:00 2026-05-14T04:44:33+00:00

Can anyone help me with reversing this PHP page navigation? Current script setting shows

  • 0

Can anyone help me with reversing this PHP page navigation?

Current script setting shows this format: [0] | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 … 14 • Forward > • End >>>

But I really need it to reverse for this format: [14] | 13 | 12 | 11| 10 | 9 | 8 | 7 | 6 … 0 • Back > • Start >>>

Here is the PHP code:

<?
$onpage = 10; // on page

function page(){
if(empty($_GET["page"])){
$page = 0;
} else {
if(!is_numeric($_GET["page"])) die("Bad page number!");
$page = $_GET["page"];
}
return $page;
}

function navigation($onpage, $page){
//----------------
$countt = 150;
$cnt=$countt; // total amount of entries
$rpp=$onpage; // total entries per page
$rad=4;       // amount of links to show near current page (2 left + 2 right + current page = total 5)

$links=$rad*2+1;
$pages=ceil($cnt/$rpp);
if ($page>0) { echo "<a href=\"?page=0\"><<< Start</a> <font color='#CCCCCC'>•</font> <a href=\"?page=".($page-1)."\">< Back</a> <font color='#CCCCCC'>•</font>"; }
$start=$page-$rad;
if ($start>$pages-$links) { $start=$pages-$links; }
if ($start<0) { $start=0; }
$end=$start+$links;
if ($end>$pages) { $end=$pages; }
for ($i=$start; $i<$end; $i++) {
echo "  ";
if ($i==$page) {
echo "[";
} else {
echo "<a href=\"?page=$i\">";
}

echo $i;
if ($i==$page) {
echo "]";
} else {
echo "</a>";
}
if ($i!=($end-1)) { echo "  <font color='#CCCCCC'>|</font>"; }
}
if ($pages>$links&&$page<($pages-$rad-1)) { echo " ... <a href=\"?page=".($pages-1)."\">".($pages-1)."</a>"; }
if ($page<$pages-1) { echo "  <font color='#CCCCCC'>•</font>  <a href=\"?page=".($page+1)."\">Forward ></a>  <font color='#CCCCCC'>•</font>  <a href=\"?page=".($pages-1)."\">End >>></a>"; }
}

$page = page(); // detect page
$navigation = navigation($onpage, $page); // detect navigation
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:44:34+00:00Added an answer on May 14, 2026 at 4:44 am

    I found the solution for my question. Here is a link to reversed page navigation: php page navigation by serial number

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer GROUP is indeed a reserved keyword, you'll have to escape… May 16, 2026 at 12:30 pm
  • Editorial Team
    Editorial Team added an answer You need to use closures to pass variables into functions:… May 16, 2026 at 12:30 pm
  • Editorial Team
    Editorial Team added an answer Maybe you can use the following: >>> x = xattr.get_all('tiger_8a428_userdvd.dmg')… May 16, 2026 at 12:30 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

can anyone help? I have a problem aligning rounded corners in IE6/7. Basically everything
Can anyone help me? I can't figure out what I am doing wrong but
I need to customize my table view can anyone help me how to do
thanks in advance for your help. I'm using this piece of code to replace
This is a challenge for the css gurus out there. I want to show
The following method of course works, but after a certain number of uploads (this
I have read that HttpURLConnection supports persistent connections, so that a connection can be
I have a select menu that shows/hides the livetransopts div when an option is
My javascript is having issues with the variable posy. This is all within a
I've been coding a webapp for some time now and all the layout, css

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.