php - Problem with pagination - no success yet -


O people, I'm really messing with this.

I am doing this: if there are 100 users to get from the database, I am using paging at one time and showing 10 users. When the user clicks on the next page, then the next 10 users will reach through AJAX (called AJAX on click) and others. I'm currently showing 10 page-links with the previous, previous, and previous links.

How it will flow: A.P.P.P. The link is created and the URL passes the AJAX function with each link. BFP) & amp; The goal (where I will get the result), has also been passed with the url click pengeon, this page. BPPP And the next 10 users will be shown with the help of AJAX.

This problem is: I am currently showing 1-10 links with first and last links, unable to show next and previous links because to redirect to the next or previous, Can not find a.php, i mean bf. Also, the foreach is making a link in the loop I am working hard to do this, but no success so far.

Waiting for a valuable answer.

OK, I think I understand ...

I think what you need to do is store the current page number as a javascript variable.

Update: Click on another

Ideas, here is a better idea to link your AJAX call directly into your link Keeping means that you have to keep the URL together and update it, which is strange and upset. It is not ideal, instead it is better to store this variable and some set functions work with them in a set manner. So, you may have something like this:

  & lt; A href = "javascript: zero (0)" onclick = "goto nextpage ()" & gt;  

Rather than passing the number of pages to go to them, you can store the current page number in the JavaScript variable and do something like this:

 < Code> GotoNextPage () {// current page number assumes that this function is stored in the defined // variable which is curr_page curr_page ++; // Existing call_exax increase ('user_info.php? Pageno =' + curr_page); }  

This way the code of the link can never be changed.

You still have other variables (like 'order', 'paper' etc.) () but you feel that you do not need it.

Keep in mind some things: 1. Using jQuery or doing something like this will probably make things easier for you. 2. Any JavaScript that is not enabled will not be able to use your site.

  & lt ;? Php echo '& lt; A href = "your_main_page.php? Page_number = ', ($ curr_page + 1),' 'onclick =" gotoNextPage ")" & gt; '; ? & Gt;  

In this way, it will work through AJAX method, but will work for people without javascript (if not readily and reloaded from the page) though this may be a bit more Work is ... so cap is your choice!

Hope that makes sense it has been a long day!


Comments