[PHP] Distinguishing between multiple browser windows for the same php session

2005-09-03 Thread Chris Stenton

I need a way of setting the session_vars specific to a users browser window
for the case of the user having multiple windows open for the same php
session. Is this possible in php?

I know you can pickup the window id via "self" in JavaScript but I can't see
how you can link this back to the server side session vars. I can't find a
PHP var that has this information.

Thanks

Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Distinguishing between multiple browser windows for thesame php session

2005-09-03 Thread Chris Stenton
> Gustav Wiberg wrote:
>>   ?
>
> Please don't top-post [1].
>
> This will not work. $_SELF isn't even a defined variable, unless you 
> defined it yourself.
>
> PHP works on the server, *before* anything is sent on the client, so it 
> has no way to know client-side things like what browser window you are in.
>
> You could place the value in a hidden form field with JS and then post 
> back to the server, but something tells me you may be approaching the 
> problem in the wrong way. Without more details I can't suggest 
> alternatives, though.

My problem is that I have a database system where I have a form to define a
search  pattern of the database
which gets placed in session_vars. The user then can use a whole bunch of
php pages to work with this search criteria.

My problem is that if the user does "file new window" in the browser s/he
can then define a new search pattern which
would change the session_vars behind the back of the other window and cause
havoc on that window. I really don't want to
put the search criteria as part of the URI between all these pages and use
GET to pull the data off as the user
could fiddle with the line and again cause problems. It probably would be
nice to be able to stop "file new window"
from working but I have not found a way of doing this.

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php