There is such code:

<a href="?r=showpost&page=0"><b class="pagination">1</b></a> <?php for($i = 2; $i <= $this->count[0][0]/2; $i++):?> <a href="?r=showpost&page=<?php echo $i;?>"><b class="pagination"><?php echo ceil($i);?></b></a> <?php endfor;?> <a href="?r=showpost&sort=autor">AutorName> </a> <a href="?r=showpost&sort=autor_email">AutorEmail </a> 

If I click on the page, will the url be like this? r = showpost & page = 1; If you sort the posts then the url will be like this? r = showpost & sort = name;

and I want to receive through GET both

like this? r = showpost & sort = name & page = 1;

what am i doing wrong

    2 answers 2

    Several options. Or write a function in php that will check the URL parameters and build them, or use the url.js plugin, which also forms URLs from the parameters. From practice, url.js has become much more convenient for me. which easily adds parameters to url and works with them.

      You simply do not pass on the link page:

       a href="?r=showpost&sort=autor<?php echo $_GET['page'] ? '&page='.$_GET['page'] : '' ?>">AutorName /a 
      • Thank you very much, Artem, it all worked. The head does not think at all. - BibbaSam