Connecting Tech Pros Worldwide Forums | Help | Site Map

Passing a variable to a frameset

Hans
Guest
 
Posts: n/a
#1: Jul 17 '05
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



Jon Trelfa
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Passing a variable to a frameset


Hans wrote:
[color=blue]
> 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
>
>[/color]

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

Hans
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Passing a variable to a frameset


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" <treefrog@NOSPAM.nobleaccord.com> wrote in message
news:xcydnajis5u_F6zd4p2dnA@comcast.com...[color=blue]
> Hans wrote:
>[color=green]
> > 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[/color][/color]
within[color=blue][color=green]
> > the frameset.
> >
> > What is the best way of getting this done.
> > Thanks
> > Hans
> >
> >[/color]
>
> 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
>[/color]


ShipiboConibo
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Passing a variable to a frameset


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" <hjkiesouw@yahoo.com> wrote in message
news:c0s42c$2c8$1@ctb-nnrp2.saix.net...[color=blue]
> 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[/color]
set[color=blue]
> 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[/color]
the[color=blue]
> city.php page.
>
> If I have a frameset called city_frameset.php and then within that[/color]
frameset[color=blue]
> 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[/color]
has[color=blue]
> more links derived from a record set and the links used will then change[/color]
the[color=blue]
> 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" <treefrog@NOSPAM.nobleaccord.com> wrote in message
> news:xcydnajis5u_F6zd4p2dnA@comcast.com...[color=green]
> > Hans wrote:
> >[color=darkred]
> > > Hi There,
> > > I have a page that has links with some variables and I need to open[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > results set in a frameset. I have tried doing this in various[/color][/color][/color]
different[color=blue][color=green][color=darkred]
> > > ways, but still cannot get the variable passed to the relevant frames[/color][/color]
> within[color=green][color=darkred]
> > > the frameset.
> > >
> > > What is the best way of getting this done.
> > > Thanks
> > > Hans
> > >
> > >[/color]
> >
> > 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
> >[/color]
>
>[/color]


Hans
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Passing a variable to a frameset


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...[color=blue]
> 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[/color]
would[color=blue]
> do the trick.
>
> Adam
>
> "Hans" <hjkiesouw@yahoo.com> wrote in message
> news:c0s42c$2c8$1@ctb-nnrp2.saix.net...[color=green]
> > Jon,
> > Thanks, I did try this. Maybe I don't understand the problem. I have a[/color][/color]
non[color=blue][color=green]
> > frames page list.php, there are links that are generated from a record[/color]
> set[color=green]
> > 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[/color]
> the[color=green]
> > city.php page.
> >
> > If I have a frameset called city_frameset.php and then within that[/color]
> frameset[color=green]
> > there is city.php I don't get the variable passed to the city.php page.[/color][/color]
I[color=blue][color=green]
> > also need this variable for other frames in the page as the city.php[/color][/color]
frame[color=blue][color=green]
> > will have related information to the city and the main frame page (the
> > centre portion) will carry other related information. The city.php page[/color]
> has[color=green]
> > more links derived from a record set and the links used will then change[/color]
> the[color=green]
> > main frame (centre) portion of the frameset.
> > Using the GET function gives me an error that the variable is not[/color][/color]
defined.[color=blue][color=green]
> > This tells me that the frameset is not getting the variable to the page[/color][/color]
in[color=blue][color=green]
> > question (city.php).
> >
> > Any help would be appreciated
> > Hans
> >
> > "Jon Trelfa" <treefrog@NOSPAM.nobleaccord.com> wrote in message
> > news:xcydnajis5u_F6zd4p2dnA@comcast.com...[color=darkred]
> > > Hans wrote:
> > >
> > > > Hi There,
> > > > I have a page that has links with some variables and I need to open[/color][/color]
> the[color=green][color=darkred]
> > > > results set in a frameset. I have tried doing this in various[/color][/color]
> different[color=green][color=darkred]
> > > > ways, but still cannot get the variable passed to the relevant[/color][/color][/color]
frames[color=blue][color=green]
> > within[color=darkred]
> > > > 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[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > 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
> > >[/color]
> >
> >[/color]
>
>[/color]


Perttu Pulkkinen
Guest
 
Posts: n/a
#6: Jul 17 '05

re: Passing a variable to a frameset


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





Geoff Berrow
Guest
 
Posts: n/a
#7: Jul 17 '05

re: Passing a variable to a frameset


I noticed that Message-ID: <c0s11n$v0$1@ctb-nnrp2.saix.net> from Hans
contained the following:
[color=blue]
>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.[/color]

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/
Savut
Guest
 
Posts: n/a
#8: Jul 17 '05

re: Passing a variable to a frameset


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...[color=blue]
> 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[/color]
would[color=blue]
> do the trick.
>
> Adam
>
> "Hans" <hjkiesouw@yahoo.com> wrote in message
> news:c0s42c$2c8$1@ctb-nnrp2.saix.net...[color=green]
> > Jon,
> > Thanks, I did try this. Maybe I don't understand the problem. I have a[/color][/color]
non[color=blue][color=green]
> > frames page list.php, there are links that are generated from a record[/color]
> set[color=green]
> > 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[/color]
> the[color=green]
> > city.php page.
> >
> > If I have a frameset called city_frameset.php and then within that[/color]
> frameset[color=green]
> > there is city.php I don't get the variable passed to the city.php page.[/color][/color]
I[color=blue][color=green]
> > also need this variable for other frames in the page as the city.php[/color][/color]
frame[color=blue][color=green]
> > will have related information to the city and the main frame page (the
> > centre portion) will carry other related information. The city.php page[/color]
> has[color=green]
> > more links derived from a record set and the links used will then change[/color]
> the[color=green]
> > main frame (centre) portion of the frameset.
> > Using the GET function gives me an error that the variable is not[/color][/color]
defined.[color=blue][color=green]
> > This tells me that the frameset is not getting the variable to the page[/color][/color]
in[color=blue][color=green]
> > question (city.php).
> >
> > Any help would be appreciated
> > Hans
> >
> > "Jon Trelfa" <treefrog@NOSPAM.nobleaccord.com> wrote in message
> > news:xcydnajis5u_F6zd4p2dnA@comcast.com...[color=darkred]
> > > Hans wrote:
> > >
> > > > Hi There,
> > > > I have a page that has links with some variables and I need to open[/color][/color]
> the[color=green][color=darkred]
> > > > results set in a frameset. I have tried doing this in various[/color][/color]
> different[color=green][color=darkred]
> > > > ways, but still cannot get the variable passed to the relevant[/color][/color][/color]
frames[color=blue][color=green]
> > within[color=darkred]
> > > > 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[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > 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
> > >[/color]
> >
> >[/color]
>
>[/color]

Hans
Guest
 
Posts: n/a
#9: Jul 17 '05

re: Passing a variable to a frameset


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" <blthecat@ckdog.co.uk> wrote in message
news:fvt330p9ra0sqmgif69p4haugln2e97m8o@4ax.com...[color=blue]
> I noticed that Message-ID: <c0s11n$v0$1@ctb-nnrp2.saix.net> from Hans
> contained the following:
>[color=green]
> >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[/color][/color]
within[color=blue][color=green]
> >the frameset.
> >
> >What is the best way of getting this done.[/color]
>
> Try this (I've only used underscores to stop the line breaking)
>[/color]
http://www.ckdog.co.uk/php/temp/fram..._telling&locat
ion=South_Africa[color=blue]
>
> 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/[/color]


Closed Thread