473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,378 developers and data experts.

Passing REFERENCE SESSION variables (session number, etc) INTO Frameset

I have found I CAN pass variables into FRAMESETS via PHP and SESSION VARIABLES, by doing the following:

in the first file:
Expand|Select|Wrap|Line Numbers
  1. $varname = "variable in question";
  2. $_SESSION['varname'] = $varname;
  3. $substitute_name = $_SESSION['varname'];
IN the FRAMESET:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. $_SESSION['varname'] = $substitute_name;
  4. echo "<html>\n";
  5. echo "<FRAMESET cols=200,*>\n";
  6. echo "<FRAME NAME=FRAME1 SRC=/frame1.php></frame>\n";
  7. echo "<FRAME NAME=FRAME2 SRC=/frame2.php></frame>\n";
  8. echo "</frameset>\n";
  9. echo "</html>\n";
  10. ?>
By setting the VARNAME FROM the SUBSITUTED NAME prevents them from interacting and freezing the access, and re-establishes the varname. Do it PRIOR to the HTML declaration, though and it carries into ALL frames.

HOWEVER... you cannot CHANGE it INSIDE a frame, to pass it back, because multiple frames have their OWN instance and changing one does NOT change the other OR the master copy. This only allows establishing PERMANENT REFERENCE variables and passing them INTO the frame.

You MIGHT want to do
Expand|Select|Wrap|Line Numbers
  1. $_SESSION['substitute_name'] = $varname;
as well in the initial declaration just to be sure it gets into the session variables.

Note BOTH files MUST be done with
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3.  
  4. pre-declared, ending in
  5.  
  6. ?>
  7.  
Which just goes without saying.
Dec 17 '11 #1
0 4072

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Brad | last post by:
Hi everyone, I've been using ASP on a few different projects over the past year, either using Javascript or VBScript. During that time, I've made use of session variables, but even then, I've...
4
by: A Web Master | last post by:
I am designing a site for a client where I have a frameset and 3 frames (all in ASP). I am creating session variables in the frameset that need to be accessed in the frames. It seams that in...
3
by: Microsoft | last post by:
I am using Session variables in my ASP application. I have tested the application on a Win2k professional and it works fine. When the same web app is installed on a win2k advanced server from the...
0
by: mbosco51 | last post by:
I know this is a common thread, but I seem to be losing session variables on my website. I read through everything I could find, including this link: http://aspfaq.com/show.asp?id=2157, but cannot...
4
by: Sugapablo | last post by:
When users log into my website, they're given session variables: Session("userid") = Let's say I have 7 users logged in. Is there a way to somehow loop through all the sessions and return all...
8
by: Radu Colceriu | last post by:
HI, I've an asp.net app like this: login.aspx (no frame) :- save in session the user and pass -> framedoc.html :- frameset 2 content 1. menu.aspx...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
22
by: K. A. | last post by:
I have two servers at work, 'A' for testing and development, and server 'B' for production. On server A, I wrote a PHP test code to login users then direct them to a personalized page. This is...
3
by: mikeboston | last post by:
Hi, I am attempting to use php session variables on a server which is running Red Hat Linux, but the variables don't seem to be getting passed between pages. I have tried the same exact test...
1
by: KidQuin | last post by:
I am having problems with session value between pages. Happening in both firefox and IE7. I go between page by links so I know it's not header changes. I use session_start as the first line on the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.