How to use pagination in pages that are coming through ajax?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RishikeshJha
Forum Newbie
Posts: 11
Joined: Tue Mar 31, 2009 1:54 am

How to use pagination in pages that are coming through ajax?

Post by RishikeshJha »

hi,

i am using ajax for showing result in a page. how can i use pagination on these pages. i am using prev and next link.

this is the code:

<a href="index.php?pagenum=<?php echo $prev;?>"> << PREV >></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="index.php?pagenum=<?php echo $next;?>"> << NEXT >> </a>
</div>

i am sending each result pages on the index pages through ajax. i have written the above code for it. but the result and not changing. It menas i m not redirection the page properly. can anyone give me solution how to redirect to the ajax pages.

thanks
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: How to use pagination in pages that are coming through ajax?

Post by it2051229 »

I was able to achieve this.. like this is how it goes:

1. client clicks on the next page.
2. the current page will be sent to the server via ajax
3. the server will query the next page based from the given current page received.
4. the server updates the NEW PAGE
5. the server will return the queried results PLUS the NEW PAGE
6. the client now receives the queried results PLUS the NEW PAGE
7. client now will replace its current page to the NEW PAGE.
8. then go back to step number 1 again.

taadddaaaaa.... there it is.
Post Reply