// $_SESSION[page] determines what part to show (obviously
// there is more code than what is listed here, but it is not relevant
// to this issue. If you need it, please ask, but be warned - it is quite large.
Ok, so far, so good. Everything works. Now, I need to implement a link submit system to jump to any page, not just consecutive pages like above (although I still need the above code). So, I add:
That works, too. HOWEVER, when the links are used to navigate, any values within the form (<input> etc.) are not saved in the session. Does anyone see a way around this? Even though it is JS, there's got to be some way to save to a PHP session... I'm thinking some kind of hidden <input>, but that may be way off track?
As far as I can see there's no reason that wouldn't work just like a standard html submit. Is the data actually there when you do:
If it is then you should be able to assign it to your sessions without a problem and there should be no problem with previously assigned sessions being carried from one page to the next, that's what they are for after all. Try doing print_r($_SESSION); too and see if there is any session data stored, it could be that it's just not being stored how you expect and needs to be accessed differently. Also, does each page that you're posting to have session_start() at the top?
is how it should have read. Now the problem is it won't go to the jump page - it returns to the current page (removing "return false;" has the opposite effect - jumps but doesn't submit . Moving my question to the JS form now!
thanks for the help in figuring out where the problem was.
quick question for you.
If its pagination your looking at, this can be done fully with php, and simply as well.
Just thought I'd point out...
I know how unreliable js can be - it isn't the only way to navigate, but it is an option. In short, I have two buttons ("<<<" and ">>>") that move forward and back exactly one section. That is done w/ php so anyone can use it. In addition, I have a list of numeric links (1 2 3 ... 14) that, when clicked, move to that specific section. That is done in JS. If there is a way to do that in PHP, I'm all ears! Since it is a text link, not an HTML form input, I was under the impression that JS HAD to be used to make it submit the form. am I wrong?
Now, you can easily create php to handle pagination such as this, look at the bottom of the forums here for instance, you'll have a set of links like so:
< 2 3 4 >
Its not the most simple task, but it certainly isn't the most difficult. The problem arises with your current structure. Without knowing how you generate the pagination, and exactly how it relates to each other, I cannot give you any advice with it. And it may not be worthwhile either. So long as your users can go from page to page, they will be happy. So thats what matters