By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,742 Members | 793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,742 IT Pros & Developers. It's quick & easy.

Passing a variable to a frameset

P: n/a
Hi There,
I have a page that has links with some variables and I need to open the
results set in a frameset. I have tried doing this in various different
ways, but still cannot get the variable passed to the relevant frames within
the frameset.

What is the best way of getting this done.
Thanks
Hans
Jul 17 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Hans wrote:
Hi There,
I have a page that has links with some variables and I need to open the
results set in a frameset. I have tried doing this in various different
ways, but still cannot get the variable passed to the relevant frames within
the frameset.

What is the best way of getting this done.
Thanks
Hans


I don't know if this is the "best" way, but why not use "get"?

--------------------
frame A
--------------------
frame B


--------------------

if there was a variable in a script in frame a, then you could print the
var like this:
<a href="someFile.php?var1=<?= $var1 ?>" target="frame b">Link</a>

Then, in frame B, you could do something like this:

$variable = $_GET["var1"];

HTH,

Jon

Jul 17 '05 #2

P: n/a
Jon,
Thanks, I did try this. Maybe I don't understand the problem. I have a non
frames page list.php, there are links that are generated from a record set
like:

<a href="city.php?City=<?php echo $row_RsCities['PlaceName']; ?>"
class="citynav"><?php echo $row_RsCities['PlaceName']; ?></a>

It works fine to a single page, but I now need to use a new frameset for the
city.php page.

If I have a frameset called city_frameset.php and then within that frameset
there is city.php I don't get the variable passed to the city.php page. I
also need this variable for other frames in the page as the city.php frame
will have related information to the city and the main frame page (the
centre portion) will carry other related information. The city.php page has
more links derived from a record set and the links used will then change the
main frame (centre) portion of the frameset.
Using the GET function gives me an error that the variable is not defined.
This tells me that the frameset is not getting the variable to the page in
question (city.php).

Any help would be appreciated
Hans

"Jon Trelfa" <tr******@NOSPAM.nobleaccord.com> wrote in message
news:xc********************@comcast.com...
Hans wrote:
Hi There,
I have a page that has links with some variables and I need to open the
results set in a frameset. I have tried doing this in various different
ways, but still cannot get the variable passed to the relevant frames within the frameset.

What is the best way of getting this done.
Thanks
Hans


I don't know if this is the "best" way, but why not use "get"?

--------------------
frame A
--------------------
frame B


--------------------

if there was a variable in a script in frame a, then you could print the
var like this:
<a href="someFile.php?var1=<?= $var1 ?>" target="frame b">Link</a>

Then, in frame B, you could do something like this:

$variable = $_GET["var1"];

HTH,

Jon

Jul 17 '05 #3

P: n/a
Seems like Jon's method should work... but have you tried cookies or
creating a session even? never used either with frames, but I image it would
do the trick.

Adam

"Hans" <hj*******@yahoo.com> wrote in message
news:c0**********@ctb-nnrp2.saix.net...
Jon,
Thanks, I did try this. Maybe I don't understand the problem. I have a non
frames page list.php, there are links that are generated from a record set like:

<a href="city.php?City=<?php echo $row_RsCities['PlaceName']; ?>"
class="citynav"><?php echo $row_RsCities['PlaceName']; ?></a>

It works fine to a single page, but I now need to use a new frameset for the city.php page.

If I have a frameset called city_frameset.php and then within that frameset there is city.php I don't get the variable passed to the city.php page. I
also need this variable for other frames in the page as the city.php frame
will have related information to the city and the main frame page (the
centre portion) will carry other related information. The city.php page has more links derived from a record set and the links used will then change the main frame (centre) portion of the frameset.
Using the GET function gives me an error that the variable is not defined.
This tells me that the frameset is not getting the variable to the page in
question (city.php).

Any help would be appreciated
Hans

"Jon Trelfa" <tr******@NOSPAM.nobleaccord.com> wrote in message
news:xc********************@comcast.com...
Hans wrote:
Hi There,
I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable passed to the relevant frames within the frameset.

What is the best way of getting this done.
Thanks
Hans


I don't know if this is the "best" way, but why not use "get"?

--------------------
frame A
--------------------
frame B


--------------------

if there was a variable in a script in frame a, then you could print the
var like this:
<a href="someFile.php?var1=<?= $var1 ?>" target="frame b">Link</a>

Then, in frame B, you could do something like this:

$variable = $_GET["var1"];

HTH,

Jon


Jul 17 '05 #4

P: n/a
Hi Adam,
I have tried a session, but with no luck. Maybe I am not setting the session
correctly. My code looks like this:

<?php
session_start();
if (isset($HTTP_GET_VARS['City'])) {$City = $HTTP_GET_VARS['City'];
session_register("City");
}
?>

Thanks
Hans

"ShipiboConibo" <shipiboconibo@[no_spam}yahoo.com> wrote in message
news:0JgYb.93$nI1.81@okepread05...
Seems like Jon's method should work... but have you tried cookies or
creating a session even? never used either with frames, but I image it would do the trick.

Adam

"Hans" <hj*******@yahoo.com> wrote in message
news:c0**********@ctb-nnrp2.saix.net...
Jon,
Thanks, I did try this. Maybe I don't understand the problem. I have a non
frames page list.php, there are links that are generated from a record

set
like:

<a href="city.php?City=<?php echo $row_RsCities['PlaceName']; ?>"
class="citynav"><?php echo $row_RsCities['PlaceName']; ?></a>

It works fine to a single page, but I now need to use a new frameset for

the
city.php page.

If I have a frameset called city_frameset.php and then within that

frameset
there is city.php I don't get the variable passed to the city.php page. I also need this variable for other frames in the page as the city.php frame will have related information to the city and the main frame page (the
centre portion) will carry other related information. The city.php page

has
more links derived from a record set and the links used will then change

the
main frame (centre) portion of the frameset.
Using the GET function gives me an error that the variable is not defined. This tells me that the frameset is not getting the variable to the page in question (city.php).

Any help would be appreciated
Hans

"Jon Trelfa" <tr******@NOSPAM.nobleaccord.com> wrote in message
news:xc********************@comcast.com...
Hans wrote:

> Hi There,
> I have a page that has links with some variables and I need to open the > results set in a frameset. I have tried doing this in various different > ways, but still cannot get the variable passed to the relevant frames within
> the frameset.
>
> What is the best way of getting this done.
> Thanks
> Hans
>
>

I don't know if this is the "best" way, but why not use "get"?

--------------------
frame A
--------------------
frame B


--------------------

if there was a variable in a script in frame a, then you could print

the var like this:
<a href="someFile.php?var1=<?= $var1 ?>" target="frame b">Link</a>

Then, in frame B, you could do something like this:

$variable = $_GET["var1"];

HTH,

Jon



Jul 17 '05 #5

P: n/a
maybe here is some misunderstanding?

<frameset>
<frame name=a
src=link_page?city=<?=urlencode($city)?>&topic=<?= urlencode($topic)?>>
<frame name=b src=map_page?city=<?=urlencode($city)?>>
</frameset>

sorry, such a long time i've worked with html frames,
but all in all this look to me the right way to pass some vars
to frames - which are another pagerequests in themselves

Jul 17 '05 #6

P: n/a
I noticed that Message-ID: <c0*********@ctb-nnrp2.saix.net> from Hans
contained the following:
Hi There,
I have a page that has links with some variables and I need to open the
results set in a frameset. I have tried doing this in various different
ways, but still cannot get the variable passed to the relevant frames within
the frameset.

What is the best way of getting this done.


Try this (I've only used underscores to stop the line breaking)
http://www.ckdog.co.uk/php/temp/fram...n=South_Africa

The frameset looks like this:
<frameset rows="205,*" frameborder="NO" border="0" framespacing="0"
cols="*">
<frame name="topFrame" scrolling="AUTO" src="top.php<?php print
"?name=".$_GET['name']; ?>" frameborder="YES" >
<frameset cols="388,*" frameborder="NO" border="0" framespacing="0"
rows="*">
<frame name="leftFrame" scrolling="AUTO" src="left.php<?php print
"?age=".$_GET['age']; ?>" frameborder="YES">
<frame name="mainFrame" src="right.php<?php print
"?location=".$_GET['location']; ?>" frameborder="YES" scrolling="AUTO">
</frameset>
</frameset>

and the individual frames simply contain

Top frame
Your name is <?php print $_GET['name']; ?>

Left frame
Your age is <?php print $_GET['age']; ?>

Right frame
Your location is <?php print $_GET['name']; ?>
If this doesn't work, check the version of your PHP is greater than
4.1.0
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #7

P: n/a
Why would you use session for this ? nonsense. Hans method is what should be
used.

<frameset cols="205,*">
<frame name="leftFrame" src="city_frame.php">
<frame name="rightFrame" src="city.php">
</frameset>
city_frame.php
-----------------------------------------
<a href="city.php?city=Montreal" target="rightFrame">Montreal</a>
<a href="city.php?city=NY" target="rightFrame">NY</a>
<a href="city.php?city=Africa" target="rightFrame">Africa</a>

city.php
-----------------------------------------
echo $_GET["city"];

Even with more frames, the concept is the same... Good luck.

Savut

"ShipiboConibo" <shipiboconibo@[no_spam}yahoo.com> wrote in message
news:0JgYb.93$nI1.81@okepread05...
Seems like Jon's method should work... but have you tried cookies or
creating a session even? never used either with frames, but I image it would do the trick.

Adam

"Hans" <hj*******@yahoo.com> wrote in message
news:c0**********@ctb-nnrp2.saix.net...
Jon,
Thanks, I did try this. Maybe I don't understand the problem. I have a non
frames page list.php, there are links that are generated from a record

set
like:

<a href="city.php?City=<?php echo $row_RsCities['PlaceName']; ?>"
class="citynav"><?php echo $row_RsCities['PlaceName']; ?></a>

It works fine to a single page, but I now need to use a new frameset for

the
city.php page.

If I have a frameset called city_frameset.php and then within that

frameset
there is city.php I don't get the variable passed to the city.php page. I also need this variable for other frames in the page as the city.php frame will have related information to the city and the main frame page (the
centre portion) will carry other related information. The city.php page

has
more links derived from a record set and the links used will then change

the
main frame (centre) portion of the frameset.
Using the GET function gives me an error that the variable is not defined. This tells me that the frameset is not getting the variable to the page in question (city.php).

Any help would be appreciated
Hans

"Jon Trelfa" <tr******@NOSPAM.nobleaccord.com> wrote in message
news:xc********************@comcast.com...
Hans wrote:

> Hi There,
> I have a page that has links with some variables and I need to open the > results set in a frameset. I have tried doing this in various different > ways, but still cannot get the variable passed to the relevant frames within
> the frameset.
>
> What is the best way of getting this done.
> Thanks
> Hans
>
>

I don't know if this is the "best" way, but why not use "get"?

--------------------
frame A
--------------------
frame B


--------------------

if there was a variable in a script in frame a, then you could print

the var like this:
<a href="someFile.php?var1=<?= $var1 ?>" target="frame b">Link</a>

Then, in frame B, you could do something like this:

$variable = $_GET["var1"];

HTH,

Jon




Jul 17 '05 #8

P: n/a
Hi All,
Thanks for all the help.

I did find a solution to the problem by simply adding the City parameter to
the frameset like this:

<frame src="topframe.php?City=<?php echo $_GET['City']; ?>" name="topFrame"
scrolling="NO" noresize >
<frameset rows="*" cols="239,*" framespacing="0" frameborder="NO"
border="0">
<frame src="list.php?City=<?php echo $_GET['City']; ?>" name="leftFrame"
scrolling="yes" noresize>
<frame src="main_frame.php?City=<?php echo $_GET['City']; ?>"
name="mainFrame">

Thanks again

Hans

"Geoff Berrow" <bl******@ckdog.co.uk> wrote in message
news:fv********************************@4ax.com...
I noticed that Message-ID: <c0*********@ctb-nnrp2.saix.net> from Hans
contained the following:
Hi There,
I have a page that has links with some variables and I need to open the
results set in a frameset. I have tried doing this in various different
ways, but still cannot get the variable passed to the relevant frames withinthe frameset.

What is the best way of getting this done.
Try this (I've only used underscores to stop the line breaking)

http://www.ckdog.co.uk/php/temp/fram..._telling&locat
ion=South_Africa
The frameset looks like this:
<frameset rows="205,*" frameborder="NO" border="0" framespacing="0"
cols="*">
<frame name="topFrame" scrolling="AUTO" src="top.php<?php print
"?name=".$_GET['name']; ?>" frameborder="YES" >
<frameset cols="388,*" frameborder="NO" border="0" framespacing="0"
rows="*">
<frame name="leftFrame" scrolling="AUTO" src="left.php<?php print
"?age=".$_GET['age']; ?>" frameborder="YES">
<frame name="mainFrame" src="right.php<?php print
"?location=".$_GET['location']; ?>" frameborder="YES" scrolling="AUTO">
</frameset>
</frameset>

and the individual frames simply contain

Top frame
Your name is <?php print $_GET['name']; ?>

Left frame
Your age is <?php print $_GET['age']; ?>

Right frame
Your location is <?php print $_GET['name']; ?>
If this doesn't work, check the version of your PHP is greater than
4.1.0
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

Jul 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.