Didn't know if this would require client side or server side attention so I took a stab at this forum, because I think I might have to knock up some completely crap hidden input type work around or maybe use sessions.
I'm currently making a page which parses results from a MySQL table. With a load of HTML form elements at the top you can define the results, you can sort, search and choose how many results to display. This works fine and dandy, and for the sort and record display forms the information is sent in the $_GET array. For some unknown reason I chose to use $_POST for the search data, but anyway...
For example, if someone chooses to display 1 record per page the page auto refreshes and shows that, and then if the user chooses to sort the results by ID, the page will forget that it's only displaying one record per page, and go to the default.
I've now gathered that it isn't possible (or atleast it doesn't work for me...) to pass $_GET data by specifying it in the action attribute of the form tag.
So now I'm thinking I'm either going to have to set the whole $_REQUEST array into a session or set the whole $_REQUEST array into hidden input fields in a HTML form and use JavaScript to auto submit this form aswell as any other forms that get submitted.
I'm using pagination at the bottom of the page, and decided upon text links for the pages, I loop through the $_GET array in that for the links, and manage to retain it through pages. So now I'm considering scrapping submit buttons altogether, and using text links for the forms at the top, and then just using JavaScript to pass the stuff in the fields along in the text link as $_GET data.
This must be a pretty common problem so I'm presuming theres a common way to do it which is probably alot better than any method I've mentioned
Thanks for any help.
On a side note: When using the get method with HTML forms, is there any way to stop the submit buttons value being passed along aswell? I know it sounds stupid because then you wont know if the form is set or not, but if I'm going to retain the $_GET data each time I will collectively have loads of forms submitting at once and my script will go haywire.