Div and php playing nice together
Posted: Thu Jan 28, 2010 3:54 pm
Ok I know the subject isn't the most helpful but just here me out:
I have a site where multiple divs are being shown or hidden based on where the user clicks. Now lets say he clicks on Div A well then Div B and Div C will hidden with javascript. If he then clicks on the link to show Div B then Div A and Div C are hidden again with javascript. Same thing with Div C it hides Div A and Div B.
Now if the page refreshes it goes back to the default (all divs hidden) rather then remember which one was open last. How I was thinking of making this work is lets say example.com/index.php is my website.
When they click on a div the url becomes example.com/index.php?div=A or example.com/index.php?div=B
My problem with doing it this way is I don't know how to make php for change the url based on which link a user clicks, and how to make it so that which ever div is in url is the one that is open. Any help would be greatly appreciated and if you need any more clarification please let me know. I know I can be confusing sometimes :p
I have a site where multiple divs are being shown or hidden based on where the user clicks. Now lets say he clicks on Div A well then Div B and Div C will hidden with javascript. If he then clicks on the link to show Div B then Div A and Div C are hidden again with javascript. Same thing with Div C it hides Div A and Div B.
Now if the page refreshes it goes back to the default (all divs hidden) rather then remember which one was open last. How I was thinking of making this work is lets say example.com/index.php is my website.
When they click on a div the url becomes example.com/index.php?div=A or example.com/index.php?div=B
My problem with doing it this way is I don't know how to make php for change the url based on which link a user clicks, and how to make it so that which ever div is in url is the one that is open. Any help would be greatly appreciated and if you need any more clarification please let me know. I know I can be confusing sometimes :p