My problem: I have few buttons in the page I’m modifying – they have onclick events:
javascript:window.location.href='http://www.another.page.com/'; return false;
I have to send $_SESSION variable to redirected page. I can’t do it in previous page because the variable will be different for each button. How can I do it?
You can’t set a session variable based on what button a user clicks, because Session data is stored on the server, not on the cookie.
What you can do is give each button a different GET variable, and then push that into the Session array when your page loads.
Original Page
Other Page
Make sure to sanitize the
GETvalue though.