January 14th, 2002, 10:14 AM
location.href = pageURL.options[pageURL.selectedIndex].value;
It takes the URL holded by the fields of a SELECT form, and redirects the browser to the new URL, every time the user double clicks an option in the SELECT:
i checked my PHP session variables after the redirection to a new page and they're all empty!
What happened to the PHP session i've created in a previous page? I need to pass confidential variables to the new page,
and it sure won't be a good practise to pass them by the URL.
Is there any way to preserve the PHP session vars under these circunstances, or another tricky way to call a new page
ondblclick, like the post method, preserving the session variables?
I would apreciate your valuable help
January 14th, 2002, 11:01 AM
Normaly PHP keeps the Session alive by setting a cookie containing the Sessionid. This cookie would be send by the browser automaticly.
If now cookies is disabled try to build URLs like the following in the selectbox - that should work - at least it did for me.
If your Sessionid is name different change it to your needs.
<option value="page2.html?PHPSESSID=<?=session_id()?>">Page 2</option>