CodeIgniter Forums
Pagination & Search Queries - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Pagination & Search Queries (/showthread.php?tid=55245)



Pagination & Search Queries - El Forum - 10-16-2012

[eluser]malzahar[/eluser]
I'm having some trouble with a search feature in my current project. I have results that are displayed normally across several pages using pagination. However, when trying to add a custom search term it completely breaks the pagination.

Is there an elegant solution to making pagination work with search queries?

I noticed there is a config option to change how the URL's for pagination are setup

Code:
$config['page_query_string'] = TRUE

Which would turn
Code:
http://example.com/index.php/test/page/20

into
Code:
http://example.com/index.php?c=test&m=page&per_page=20

But when I try to use it I get an "The URI you submitted has disallowed characters." error.

I'm sure others have faced this problem but I can't seem to find a good solution as of right now


Pagination & Search Queries - El Forum - 10-17-2012

[eluser]Mr. Pickle[/eluser]
If you want to use GET parameters you have to allow it in the CI config file, I guess it's called:

Code:
$config['enable_query_strings'] = TRUE;