Page 1 of 1

using $_SESSION[' ']; to transfer data problem....

Posted: Wed Nov 23, 2011 8:33 pm
by grabber_grabbs
thanks for helping here.

ok, i have my screen divided in 2 frames... one frame (called top) has one line. The other frame (called main) has all the rest of the screen. I want to make a little image in the top section to act like a zoom or a reducer of the main content. Like if i click on the little image, that would make the content of the main screen to show data without pictures.. if i click on the little image (in the top section again) that would do the opposite.... making the main screen to show the data with the picture.
So the little image is showing pictures or removing pictures.

So the main is showing differents things depending on what it find in a $_SESSION['variable'];
in my top frame, when i click the image, i change the value of the $_SESSION['variable']; and then i do a parent.frames[1].location.reload(); to reload the main.php

looks like when i reload the main, the main is like reading the $_SESSION['variable']; from the buffer or from the ram of the client computer.... and is not reading the new value from the top.php frame....
If i do click let say 4 or 5 times... it will eventually change and would work ok for one or two more time until it stop working like for 5 or 6 times again!!!
It really looks like it is not getting the value from the server but getting it from the cookie on the client side.

Or it is acting like, the server is not responding fast ennough, that the client side script is just reloading the page before the $_SESSION['variable'] has changed...

Re: using $_SESSION[' ']; to transfer data problem....

Posted: Thu Nov 24, 2011 7:47 am
by mikeashfield
Why use frames instead of a div?

Re: using $_SESSION[' ']; to transfer data problem....

Posted: Fri Nov 25, 2011 3:22 am
by Hermit TL
I had a problem similar to this before; however, I can not tell you how to fix it as the problem was in my PHP script. If you can post the script, maybe someone can help you figure out why it's not working as expected.

Re: using $_SESSION[' ']; to transfer data problem....

Posted: Fri Nov 25, 2011 4:30 am
by maxx99
Just to make it clear
Link (frame1) -> set session variable (frame1/php) -> reload frame 2 (from frame1/js) -> read session variable and load page (frame2)

Why do you even use frames? You can use ajax request to change content in another div?

Code: Select all

http://davidwalsh.name/basic-ajax-requests-mootools
Example

Code: Select all

http://davidwalsh.name/dw-content/moo-basic-ajax.php
If you're fixed on frames:
how do you set the session variable before you reload frame2?