[SOLVED] Passing SESSION Vars

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Passing SESSION Vars

Post by AliasBDI »

Is it possible to pass SESSSION VARs over HTML frames? Before you answer look at my example:

I have a sign in form which redirects to a particular PHP file that contains frames. The redirect is according the USERS domain column. In other words, they login with user, domain, password.

The action page checks the database for the user. If the user exists and the user, domain, password are correct, it redirects them to an 'index.php' page in a directory which has the same name as their domain as recorded in the database.

The 'index.php' page is a basic framed HTML page (with 2 frames). One frame calls the local 'nav.php' page into it. The other calls another page irrelavent to my question.

The 'nav.php' page requires a query based on the user's ID column. How do I get the user's ID variable passed to that page?

(1) I figured that the SESSION could contain it. But it didn't work. Plus, I believe that SESSION variables are kept in accordance with the initial browser window and not any included frames. :( It did not work regardless.

(2) I figured I would have to pass the variable in the initial page where the user is checked against the database and then redirected. I wasn't sure how to created that redirect so that it targets both the parent and the parent's "nav" frame.

Is there another way of doing this? Or do I need to roll with option #2? If option #2 is best, do you know how to pull it off?
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Post by AliasBDI »

Ahhh. I think it does work with the SESSION vars being passed. It looks like the SESSION is good for all of the pages pulled into the frame! Unless I did something wrong, I think that is working! I think I answered my own question!
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Post by AliasBDI »

Moderator.... Please mark as SOLVED. It IS possible to send SESSION variables over window frames without passing them through URLs.
Post Reply