![]() |
Pagination Problem - 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 Problem (/showthread.php?tid=42696) |
Pagination Problem - El Forum - 06-16-2011 [eluser]bcarter[/eluser] Hi all I have a bit of a problem which I have come up against. I have recently built a lead tracking application of sorts which was working fine. Anyway I've intergrated into another project and had a go at streamlining it which has gone pretty well except..... ...the pagination. I run a search and it works just right however when I click on the '2' on the pagination links I get a 404 error, page not found. I have no idea why, can someone help me please? Here's my controller Code: <?php Now I'm assuming that because it works in the first instance there's no need to post the views or models here however, if I'm wrong (usually am) then I will post. Please help me Obi Wan, you're my only hope! Pagination Problem - El Forum - 06-16-2011 [eluser]marcogmonteiro[/eluser] How are you passing the string the user are searching from one page to another? maybe you get the 404 because there's nothing to search on the second page... That happened to me in the past. Pagination Problem - El Forum - 06-16-2011 [eluser]bcarter[/eluser] I was just about to post the code for the form which sits in the page and uses the value = set_value() method, but then I realised that when you click the pagination link it doesn't submit the form so there are no $POST values! Thanks for making me think! Just out of interest would you assign the $POST values as session variables? Pagination Problem - El Forum - 06-16-2011 [eluser]boltsabre[/eluser] You could do that, or you could also tack the search post value onto your URL and access it using the URI helper. Pagination Problem - El Forum - 06-16-2011 [eluser]marcogmonteiro[/eluser] I probably wouldn't do that. Last time I put search values on URL I had a lot of problems. When people searched stuff with spaces or Latin characters. All stuff that you shouldn't use on CodeIngiter via url. So I would go and put that on a session variable. Pagination Problem - El Forum - 06-16-2011 [eluser]boltsabre[/eluser] That's a very fair point, I didn't really think my post through too well! Pagination Problem - El Forum - 06-16-2011 [eluser]InsiteFX[/eluser] He's getting the erorr because he is not setting the uri_segment! Code: // controller/method/etc - you may need to change this to the right segment number! InsiteFX Pagination Problem - El Forum - 06-16-2011 [eluser]marcogmonteiro[/eluser] But if he's using the 3rd segment he shouldn't have any problems with that. CodeIgniter uses the 3rd has default no? |