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.
sd
in your case to get query string without ‘page’ you should call this function like this:
if you need to exclude more than one: