Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

main frame variables passed to content frame

ok, I have a strange one but I'de like to know if its possible. I have a frameset composed of two frames, a left and a right. left being navigation and right being content.  When I pass variables to the main frameset, how do I send the variables to the left frame without using one php file to build the frame?

url to frameset:

frameset.php?something=this

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

frameset.php:

<frameset cols="170,100%*" frameborder="NO" border="0" framespacing="0" rows="*">
  <frame name="leftFrame" scrolling="NO" noresize src="left.php">
  <frame name="mainFrame" src="content.php" scrolling="AUTO">
</frameset>

-------------------------------------------
left.php:

????
0
dsyn
Asked:
dsyn
  • 3
  • 2
1 Solution
 
lozlozCommented:
can you clarify what you mean, i don't quite understand? if you want a link to open in one of the frames without having to change the entire frameset, you just need to link with the target as the name of the frame.. e.g. <a href="left.php?variable=something target="leftFrame">Click here</a>

loz
0
 
dsynAuthor Commented:
I'm linking to the main frame page like this:
<a href="frameset.php?something=this">link</a>

so the left frame needs to be able to parse it, but the frameset itself (in the code) doesn't have any variables in it.

does that help? maybe?
0
 
lozlozCommented:
so why not just have

<frameset cols="170,100%*" frameborder="NO" border="0" framespacing="0" rows="*">
  <frame name="leftFrame?something=<? print $_GET["something"]; ?>" scrolling="NO" noresize src="left.php">
  <frame name="mainFrame" src="content.php" scrolling="AUTO">
</frameset>

and then do more parsing in left.php
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dsynAuthor Commented:
what is this? $_GET["something"];  

does that get variables directly from the address bar?
0
 
Muhammad WasifCommented:
yes, you can get the parameters passed in adress bar with $_GET
e.g

blahblah.com?something=some_text

echo $_GET["something"];

WASIF




0
 
dsynAuthor Commented:
whoa, that's cool!

I'm gonna try that first thing tomorrow.. I'l let ya' know.. I'm still just starting out with php, so thanks for bearing with me.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now