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 3480972
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:24:09+00:00 2026-05-18T10:24:09+00:00

I made a simple table class with pager for my project in php. It

  • 0

I made a simple table class with pager for my project in php. It works fine if the page address does not contain any params passed by GET method. Here is the way Im creating the table with pager

$tbl = new table();
$tbl->headers(array ("Header1", "Header2"));
$query = "SELECT COUNT(*) FROM table";
$tbl->pager(15, $query);           
$tbl->page = $_SERVER['PHP_SELF'];
$query = "SELECT id, name, FROM table";
$tbl->createTable($query);

I want to use it in the switch function

switch ($_GET['a']) {
        case b:
            $tbl = new table();
            $tbl->headers(array ("Header1", "Header2"));
            $query = "SELECT COUNT(*) FROM table";
            $tbl->pager(15, $query);

            $tbl->page = $_SERVER['REQUEST_URI'];
            $query = "SELECT id, name, FROM table";
            $tbl->createTable($query);
            break;
        case c:
            ...
            break;
    }

and $_SERVER['REQUEST_URI'] will pass page.php?a=b to the pager and create pager as it should be. Problem occurs when I switch between pages because REQUEST_URI each time pass page.php?a=b + actual page number I am on to the pager so the address looks like pager.php?a=b&page1&page=2.... And my question is, is there a way to pass to pager only page.php?a=b and make it to be nonchangeable or sth like that ?? Hope my question is clear.

  • 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-18T10:24:09+00:00Added an answer on May 18, 2026 at 10:24 am

    sd

    function getQE(){
         if($_GET){ 
           // exlude some variables from $_GET (pass names of variables in function call)
           $ex = func_get_args();
           $qstr  = "?";
           foreach($_GET as $key=>$value) {
              if (!in_array($key, $ex)){
                  $qstr .= $key."=".$value;
                  $qstr .= '&';
              }
           }
         }
    return $qstr;
    }
    

    in your case to get query string without ‘page’ you should call this function like this:

    $get = getQE('page');
    

    if you need to exclude more than one:

    $get = getQE('page', 'section','folder');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Heavy emphasis on simple. I've never made an installer and I'd rather not have
I just installed Ubuntu 8.04 and Eclipse. I made a very simple Hello World
I have a simple software that is made in Delphi 7, and it crashes
Today we faced a quite simple problem that were made even simpler by the
Made solution change: I am trying to display a html table of data.. In
I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework
I made a class that derives from Component: public class MyComponent: System.ComponentModel.Component { }
I am playing with MVC and I made a simple site. I have an
i want to make a simple chess program. So far i've made the board
I made a view to abstract columns of different tables and pre-filter and pre-sort

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.