如何在表单中进行可变分页?

i have page that contains a form, it works fine. but i want to add pagination to it. i've found an pagination example on the web. but, when i change the page, the values from the form are discarded, and i have to recomplete the form on the page that i want to.

i want to add pagination for 50 or 100 rows.

Any tips?

thanks, Sebastian

EDIT

i do submit the form. i want to use any way to paginate. add a drop box in the form, or an live drop box, below the table. after i submit the form, a table is printed with the entries from my database.

I don't think he's submitting the form, but clicking a link?

Whatever, as Swhistlesoft points out, you need to carry over the form values into the next page.

If you're not submitting the form to load the next page, instead just clicking a "NEXT" link your best bet is probably a javascripted onclick event to add the contents of the form to the link as a $_GET[] URL rewriting appendage thing.

?page=2&formvalue=x&formvalue2=y&formvalue3=foo etc.

then of course you'll need to get the landing page to re-insert this data into the form on generation.

You will need to use sessions ( or cookies ) to save the previous page form values. Using sessions is probably the easiest as you can assign an array to the $_SESSION global variable.

Then all you need to do is add some inline php code to each field to check if a value exists for that form field and echo it to the value attribute.

This may not be the best way, but this will definitely look good. Have a big div with overflow:hidden, then have the pagination as buttons with onclick function to move the div's margin up and down thereby giving a feeling of pagination. Its an illusion without doing any dirty hacks to pass the data.