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

  • SEARCH
  • Home
  • 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 7538911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:14:32+00:00 2026-05-30T07:14:32+00:00

I seem to be having very annoying problems, I have found a brilliant paginations

  • 0

I seem to be having very annoying problems, I have found a brilliant paginations script however it is doing me nothing but trouble, despite a long set-up time, I got it working to a ok standard, however the script doesn’t seem to understand that I want to control “ipp”.

// PAGINATOR \\

    var $items_per_page;
    var $items_total;
    var $current_page;
    var $num_pages;
    var $mid_range;
    var $low;
    var $limit;
    var $return;
    var $default_ipp = 5;
    var $querystring;
    var $ipp_array;
    var $html;


    function Paginator()
    {
        $this->current_page = 1;
        $this->mid_range = 7;
        $this->ipp_array = array(10,25,50,100,'All');

    }

    function paginate($html)
    {
        if(!isset($_GET['ipp']))
        {
            $this->items_per_page = $this->default_ipp;
        } else {
        $this->items_per_page = $_GET['ipp'];
        }
        if($_GET['ipp'] == 'All')
        {
            $this->num_pages = 1;
            $this->items_per_page = $this->default_ipp;
        }
        else
        {
            if(!is_numeric($this->items_per_page) OR $this->items_per_page <= 0) $this->items_per_page = $this->default_ipp;
            $this->num_pages = ceil($this->items_total/$this->items_per_page);
        }
        if(!isset($_GET['page']) OR $_GET['page'] == '')
        {
            $this->current_page = 1; // must be numeric > 0
        } else {
        $this->current_page = (isset($_GET['page'])) ? (int) $_GET['page'] : 1 ; // must be numeric > 0
        }
        $prev_page = $this->current_page-1;
        $next_page = $this->current_page+1;
        if($_GET)
        {
            $args = explode("&",$_SERVER['QUERY_STRING']);
            foreach($args as $arg)
            {
                $keyval = explode("=",$arg);
                if($keyval[0] != "page" And $keyval[0] != "ipp") $this->querystring .= "&" . $arg . $html;
            }
        }

Please note, the above is a snip of the full coding, you can find a full copy of the code at this address: http://net.tutsplus.com/tutorials/php/how-to-paginate-data-with-php

Okay, so the issue I am having is whatever I pass to the variable ipp through the _GET[‘ipp’], it seems to totally ignore, however echoing _GET[‘ipp’] works perfectly fine..

For example, news.php?page=2&ipp=5&id=3. When I change the IPP from 5 to another number, it will totally ignore the fact that I have done that and keep the IPP(Items per page) at 5? I am very confused with the script now, its exactly what I am looking for however just seems to not work my way.

Thank you for any potential helpers, and thanks for having a look.

Best Regards

  • 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-30T07:14:33+00:00Added an answer on May 30, 2026 at 7:14 am

    You realize if you change $_GET[‘ipp] the other values may no longer be relevant, plus who knows what else is going on without running through the code.

    My suggestion to solve your problem, some basic debugging:

    if($_GET) {
      // add some debugging here to see what all the calculated values are
      var_dump(array(
        $this->items_per_page,
        $this->items_total,
        $this->current_page,
        $this->num_pages,
        $this->mid_range,
        $this->low,
        $this->limit,
        $this->return,
        $this->default_ipp,
        $this->querystring,
        $this->ipp_array,
      ));
    
      // other code already in this block
      // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be something common and trivial, but I seem to be having trouble
I am writing a very small wordpress plugin but I seem to be having
Probably very easy but I am having trouble to figure this out (also Google
I know this is a very simple question but I seem to be having
I am having trouble setting up a query, it seems very simple but I
I seem to be having a very simple problem but I can't wrap my
I have found out that C++ standard functions show very different behavior when having
I seem to be having problems with editing a users/members information. I have provided
I seem to be having a very frustrating time with an inherited class calling
We have a cakephp app running on 2.0 and we seem to be having

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.