rfresh
01-19-2010, 04:11 PM
I have a popup window that is working ok but now I want to popup a second window exactly like it. So I modified the popup window JS code and now I can do that and get the 2nd window open - however - the two windows seem to be using the same global $_SESSION vars and that I think is the problem I'm having. The windows also do an auto refresh every minute to update the display from a database.
In the window I have a drop down list where I can select a MySQL filter value and display data based on that selected filter. When I select an item from the list and click submit, my window.php script calls window_dispatcher.php and that dispatcher script assigns my list selection into a $_SESSION var ($_SESSION["filter_value"]) and then calls window.php again.
In window.php I use that $_SESSION["filter_value"] to control the MySQL filter sql statement.
So, here's the problem: with two windows open, when I set a filter in one window, when the other window refreshes, it then assumes the first windows filter setting!. I was trying to be able to open multiple windows and set different filters in each one and have them refresh independently, but I think my $_SESSION vars, being global, are ending up being 'sync'd' when each window refreshes.
So I thought well I could just eliminate the globals vars but then I don't know how to select from a drop down list and then save that value so its used when the window.php file is called again from my dispatcher script.
Maybe there is another way to do that but I've always used the main script/dispatcher script model in my php coding.
I hope I have been clear in trying to describe my problem.
Thanks
In the window I have a drop down list where I can select a MySQL filter value and display data based on that selected filter. When I select an item from the list and click submit, my window.php script calls window_dispatcher.php and that dispatcher script assigns my list selection into a $_SESSION var ($_SESSION["filter_value"]) and then calls window.php again.
In window.php I use that $_SESSION["filter_value"] to control the MySQL filter sql statement.
So, here's the problem: with two windows open, when I set a filter in one window, when the other window refreshes, it then assumes the first windows filter setting!. I was trying to be able to open multiple windows and set different filters in each one and have them refresh independently, but I think my $_SESSION vars, being global, are ending up being 'sync'd' when each window refreshes.
So I thought well I could just eliminate the globals vars but then I don't know how to select from a drop down list and then save that value so its used when the window.php file is called again from my dispatcher script.
Maybe there is another way to do that but I've always used the main script/dispatcher script model in my php coding.
I hope I have been clear in trying to describe my problem.
Thanks