Unfortunatelly it still dosen't work... and the page calculation system is flawed...
here's what I have in adition to the above:
$pagination = $total_lines/$displaylines; // ( total_lines is the variable I obtained when I did the hidden query to determine how many records my query would have without the limit parameter / display lines is a var that hoalds the number of results per page wich defaults to 5 at the begining of the page. )
IF ( is_int ( $pagination ) )
{
$total_pages = $pagination;
}
IF ( is_float ( $pagination ) )
{
$total_pages = $pagination + 1;
}
FOR ($i=0; $i<$total_pages; $i++)
{
ECHO "<a href='display.php?page=$i$pagelink'> $i </a>";
}
well first of all the page count is always wrong... at present my DB hoalds just 6 entries... if just hit search and not select anything ( meaning that I want to display all the records ) the division should be 5 records on first page and 1 record on a second page...
the calculation should be:
$pagination=6/5=1.2; // that's float so it should take this route:
IF ( is_float ( $pagination ) )
{
$total_pages = $pagination + 1=2.2; ( is there no way to just take the integer part of a number? not rounding it )
}
the code will display 3 pages... namelly 0 1 and 2... and their code dose not work either...
when I seelct either of them I will either loose all or part of the atributes contained in the $pagelink string. and the same page loads with the same results...basicly I still loose the parameters allong the way and even if some of the parameters do make it through the reload they don't seem to work...
this is how the link to one of the pages looks like if I rightclick on it:
mydomain/display.php?page=1&combo_1%20=%201 ( this is suposing I changed the first dropdown list and selected something other then the default from it ).
Now suposedly when It reloads the page it's suposed to do this:
IF ( ISSET($_GET[combo_1]) && $_GET[combo_1]!=0 ) ( bolth are suposed to be true since I selected option 1 from the list so it should be set AND different from 0 )
{
$combo_1 = $_GET['combo_1']; // suposed to give the passed variable back to the original var. dosen't seem to happen.
$sql_line= "AND (localitate.ID = $combo_localitatedisp)"; // same as above... it's not executed.
$pagelink .= "&combo_localitatedisp = $combo_localitatedisp"; // this either...
}
so on the new page there's no parameters and the page loads all the results reguardless of what I had selected originally...
EDIT: I just checked... the IF statement is not even executed when I reload the page... the if isset dosen't recognise that I'm sending parameters via the reload link and just skips theentire tree. the problem must lie in the transmited string $pagelink!
I experiance a similar problem with the checkboxes... if I have all the checkboxes selected when I click on a new page I'll loose all but one of the checkbox parameters and that one that persists is never used and the page will still load all the records ( well it will still be limited to that wich is written in the limit parameter as the current page... )
What am I doing wrong?